简体   繁体   English

在网络中共享一个 Access 数据库并从多个 C# 应用程序连接它

[英]Sharing an Access database in the network and connect it from several C# applications

I want to share an Access database in the local network (by sharing a folder in the Windows that contains the database).我想在本地网络中共享一个 Access 数据库(通过在 Windows 中共享一个包含该数据库的文件夹)。

I want to write an application (C# windows form) that open the shared database then selects, updates and deletes some records.我想编写一个应用程序(C# Windows 窗体)打开共享数据库,然后选择、更新和删除一些记录。

Several instance of my application will be running in the network (from various computers) and all the instances open the same database.我的应用程序的几个实例将在网络中运行(来自不同的计算机)并且所有实例都打开同一个数据库。

Does changing an Access database from various computers in the network possible?是否可以从网络中的多台计算机更改 Access 数据库?

Note : I don't want to use SQL SERVER or SQL SERVER EXPRESS, because all the computers in the network are too old and too slow for installing SQL SERVER.注意:我不想使用 SQL SERVER 或 SQL SERVER EXPRESS,因为网络中的所有计算机都太旧且安装 SQL SERVER 太慢。 Installing and supporting SQL SERVER or SQL SERVER EXPRESS are hard too.安装和支持 SQL SERVER 或 SQL SERVER EXPRESS 也很困难。

First must Add Mode=Share Deny None (This will open your database file in full share mode) to connection string for Accessing multiple user,after this you can do this two ways:首先必须添加Mode=Share Deny None (这将以完全共享模式打开您的数据库文件)到连接字符串以访问多个用户,之后您可以通过两种方式执行此操作:

  1. share original app with data base in server and add it's folder as virtual drive in other system.与服务器中的数据库共享原始应用程序,并将其文件夹添加为其他系统中的虚拟驱动器。

  2. make 3 copy in each system and put DB in server,share it and change connection string to server在每个系统中制作 3 个副本并将数据库放入服务器,共享它并将连接字符串更改为服务器

If you are using ODCB driver you can simply give the shared folder on your network and let it use your database and you can run it on all systems如果您使用的是 ODCB 驱动程序,您只需在您的网络上提供共享文件夹并让它使用您的数据库,您就可以在所有系统上运行它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM