开发者

access and sql server realtime synchronization

i have a security application that stores its data in a access database.now i'm required to make a realtime synchronization (replication) between that access database and a new database in sql server 2005. these two database are the same. any suggestion?!


i don't know how to do it using a windows service or not. i need exact technical an开发者_高级运维swer.


Mostly, I would suggest you use a windows service to periodically check the MS Access db, and attempt to synchronize it with the Sql database.

This will allow you to remove the Human factor, and have this task run periodically to sync the dbs.

Have a look at

  • Creating a Basic Windows Service in C#
  • Creating a Windows Service in C#

Also

  • Connect to Microsoft Access .mdb database using C#
  • Beginners guide to accessing SQL Server through C#


SQL server has built-in replication functionality that you get for free, so you don't need to worry about copying rows & tracking changes. There are several types of SQL replication that are used for different situations, such as merge replication, snapshot replication, and transactional replication. This last one, transactional replication sounds like what you want. Merge replication is used when you have users that might disconnect, go away and return later to synchronize (like remote users). Transactional replication is used where the subscribers and publisher are reliably connected. Snapshot replication generates a new snapshot each time synchronization occurs, and doesn't think about changes to the data. Read the MSDN documentation and find which of these types is appropriate for your situation.

Using these replication methods will require that you set up your tables in a SQL server or express instance - you can use that to synchronize with your SQL server and keep everything else Access as the front end. I think you want to follow astander's suggestion and use a windows service to trigger synchronization. However you can set up the Windows Synchronization Manager to automatically try to synchronize at startup, shutdown, when the computer is idle, etc. If you need finer control over triggering the synchronization then perhapse use a Windows app or service as astander suggested.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜