pinoyz

hi

i created a simple application where the user retreive some data...

here's my problem once the user(user1) retreived the data and another user(user2) update some files...now the (user1) retreive the old files not the updated one...

i want is to prompt the user or refresh the form if the data is updated




Re: Visual Basic Express Edition prompt the user if the data is updated... how?

nobugz

You can use FileSystemWatcher to get notified that a file changed.





Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

how can i do this im a beginner on this....




Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

i saw some example here in this forums how to use FileWatcher....... but i don't really understand how to call the program(dbase)...... in some example they use console to call the program or it's automatically connect to the files (dbase) .....

do we need to loop the filesystemwatcher so that it every 5 secs you can monitor the dbase

........ thanks in advance......






Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

bump






Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

anyone

anyone know how to use FileSystemWatcher i have a difficulties on this

unable to create new FileSystemWatcher

Dim watcher as new FileSystemWatcher <--

here's my code (this is what i understand)

Form1_Activated

FileSystemWatcher1.Path = "C:\My Documents\dbase.mdb"

FileSystemWatcher1.NotifyFilter = (NotifyFilters.LastAccess Or NotifyFilters.LastWrite Or NotifyFilters.FileName Or NotifyFilters.DirectoryName)

FileSystemWatcher1.Filter = "dbase.mdb"

AddHandler FileSystemWatcher1.Changed, Addressof OnChange

AddHandler FileSystemWatcher1.Created, Addressof OnChange

AddHandler FileSystemWatcher1.Deleted, Addressof OnChange

AddHandler FileSystemWatcher1.Renamed, Addressof OnRenamed

FileSystemWatcher1.EnableRaisingEvents = True

Private Shared Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs) <-- i got an error on red color...

Msgbox ("Changed" & e.ChangeType)

End Sub

Private Shared Sub OnRenamed(ByVal source As Object, ByVal e As RenamedEventArgs)

Msgbox ("Renamed")

is it possible to monitor the specific table not the whole database






Re: Visual Basic Express Edition prompt the user if the data is updated... how?

nobugz

Put "Imports System.IO" at the top of your source code. The Path property must be set to the folder, not the file.

You haven't said, yet, what you're trying to do. I assume you're looking for another program changing or adding records to a table. While FSW will probably work, you are going to get a *lot* of false hits. So many that it is probably better just to query the table every 5 minutes or so.





Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

nobugz,

thanks for the reply........nevermind now the 5 secs ^_^........ i'm trying is to be specific on tables not whole dbase... i tried what you said.... it work great but my problem is to be specific table not the whole dbase....

sorry for not directing you to the point...T_T

thanks

pinoyz




Re: Visual Basic Express Edition prompt the user if the data is updated... how?

pinoyz

hi everyone

in using FileSystemWatcher.path we can insert the path of what folder we want right ! e.g. fsw.path ="C:\Documents"...... what about into server name of the server






Re: Visual Basic Express Edition prompt the user if the data is updated... how?

Bruno Yu - MSFT

pinoyz,

How is your problems going Please try to set the path on the server just add the server name before the file path like this:

fsw.path=\\Server\C$\Documents

You can also take a look at the instructions on FileSystemWatcher.Path Property and try the sample code in the following link:

http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.path(vs.80).aspx