简体   繁体   English

需要部署MS Access DB

[英]Need to deploy MS Access DB

I have a requirement for which I have to use MS Access as database(backend) and C# windows app as frontend. 我有一个要求,我必须使用MS Access作为数据库(后端)和C#Windows应用程序作为前端。 I need to deploy this application on multiuser connected on LAN. 我需要在局域网上连接的多用户上部署此应用程序。 So the DB is on central sever and the app installed on indivdual machines. 因此,数据库位于中央服务器上,应用程序安装在个人计算机上。 I tried using System DSN to connect the MS Access DB but could not. 我尝试使用系统DSN连接MS Access DB,但无法连接。 Please someone help with connectionstring. 请有人帮助连接字符串。

Thanks, Kanaya 谢谢金屋

You don't say why you couldn't connect to the database, but the simplest way is to use the OleDb provider for Jet (assuming of course that you have Jet installed on the client machines) 您没有说为什么无法连接到数据库,但是最简单的方法是将OleDb提供程序用于Jet(当然,假设您在客户端计算机上安装了Jet)

using System.Data;
using System.Data.OleDb;

//
// Code ...
//

OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\MyServer\Mydb.mdb");
conn.open();

//
// Use connection ...
//

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

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