简体   繁体   中英

I have a database connection string to a password-encrypted MS Access database and I need help in completing the connection string

[Connection String I need help with]

在此处输入图像描述

I am a newbie and I just learned this online. I was able to complete a project with a working connection to an MS Access database that is not encrypted. Now, I have to put password on the database as requested by the users and because of that, my connection is no longer working. So I also updated the connection string (The one in the picture). I am trying to complete this string but I do not know how to put that "Options as Long = -1". Just to add to the context, If I do not complete that string, "I am getting error 13 Type mismatch on import data", so I kinda figured out that that string should be completed and that option should be defined as long in order to get through the type mismatch. If there is also another way to this, I would be glad to learn. Appreciate any help. Thanks.

I tried just putting option: long, or options: long =-1, nothings working.

Your code is not correct. You can try the following code to open the connection

cnn.ConnectionString = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=" & dbPath & ";Mode=Share Deny None;Jet OLEDB:Database Password=testpassword"
cnn.Open

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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