简体   繁体   English

VB .NET连接到本地.MDB

[英]VB .NET CONNECT TO LOCAL .MDB

Hi guys can u tell me how can I connect to the protected by login and password local computer and open a .mdb file which one is on this computer? 嗨,大家好,我能告诉我如何连接到受登录和密码保护的本地计算机,然后打开此计算机上的.mdb文件吗?

Below is a code where Z is a local computer but B is a folder where we have our database. 下面是一个代码,其中Z是本地计算机,而B是我们拥有数据库的文件夹。 But all time i got error with that i dont have premission to open magazyn.mdb. 但是,每当我遇到错误时,我都不会打开magazyn.mdb。 Can u tell me what i must add to this connectionString to open this .mdb file 您能告诉我打开该.mdb文件必须添加的内容吗?

 conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
"\\z\b\magazyn.mdb;"

Something like this: 像这样:

conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"\\z\b\magazyn.mdb;User Id=admin;Password=password;"

See here for further examples. 有关更多示例,请参见此处

You're accessing database file on shared folder. 您正在访问共享文件夹上的数据库文件。 You must set share \\\\z\\b properties (and file system security too) to allow read/write access and additionally allow file creation - access needs to create lock (*.ldf) file. 您必须设置共享\\\\z\\b属性(以及文件系统安全性)以允许进行读/写访问并另外允许文件创建-访问需要创建锁(* .ldf)文件。

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

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