且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多次登录到ms访问数据库

更新时间:2022-11-25 08:41:55

不要尝试在多用户中使用Access - 你可以为很小的工作而逃脱它,但它只是一个用户数据库这真的不是为多用户访问而设计的,并且当你这样使用时总会给你带来巨大的悲伤。



相反,考虑SQL Server或MySQL - 它们都是多用户,如果您的代码写得很好,那么应该只是将您的类从OleDbConnection和OleDbCommand对象更改为SqlConnection和SqlCommand,或者更改为MySqlConnection和MySqlCommand对象。

然后安装相应的用户的中间服务器上的软件,添加数据库,并从您的应用程序连接到该服务器。
Don't try to use Access in multiuser - you can get away with it for really small jobs, but it's a single user DB that really isn't designed for multiuser access and which always gives huge amounts of grief when you use as such.

Instead, consider SQL Server or MySQL - they are both multiuser, and if your code is well written, it should be just a case of changing your classes from OleDbConnection and OleDbCommand objects to SqlConnection and SqlCommand, or MySqlConnection and MySqlCommand objects instead.
You then install the appropriate software on a central server for the users, add your DB, and connect from your app to that server.