Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my application there are two different application form uses same database and same table of MS access.As soon as data inserted into that table from one application form i want fire select query to display that new record in second application from.

Its a client server application...so once the user on server enter the new record client have to know updated ones...


how to do this..is it any way in C# for that..
thanks..
Posted
Updated 14-Apr-11 21:18pm
v2
Comments
Perry Bruins 15-Apr-11 1:57am    
Hmm I have seem to have deleted the first solution, but since it was not applicable anyway it is not a big problem. See for the other solution below...
vishal_h 15-Apr-11 3:17am    
yes thanks for previous response but i my forms are on diff application as the application is client server application....

As you are using Microsoft Access, you are limited in the scope of what you can do. There are two ways that an application can react to changes - one is through a push mechanism, whereby the underlying server pushes out changes to connected applications. The other mechanism is through a pull mechanism, where the applications pull the data they are interested in.

Now, you can't use a push mechanism here because Access is not designed to run as a server based application with knowledge of inbound connections. This means that you are limited to pulling the data - which indicates that you need to monitor the database for changes to records the client is interested in.

My suggestion would be to take a two pronged approach here. The first prong would be to have an updated field/table (with timestamp imfo) in place to identify what has changed. The second prong is to have your application check for changed records (on a background thread), and update itself accordingly.

Unfortunately, there's no easy way round this - there's a lot of code you're going to have to write.
 
Share this answer
 
If the forms are in in the same process, you could use a Semaphore as an interprocess communication feature.

At this time I do not have the time to whip up code, but if you consult MSDN on the usage of those resources you should be able to figure it out.
 
Share this answer
 
Is it necessary to use 2 applications. can't you use 2 forms in single application for this purpose to speed up and easiness.
 
Share this answer
 
Comments
vishal_h 15-Apr-11 3:15am    
No its not possible becouze its a client server application...so once the user on server enter the new record client have to know updated ones...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900