Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
889 views
in Technique[技术] by (71.8m points)

vb.net - Connecting to an Access database that has a database password

I've password protected an mdb file but then I cannot access it on vb.net. I don't know the correct code for defining the password. this is my current code, I know its wrong, but I don't also know the correct code:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:search.mdb;pwd=nit"
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:myFoldermyAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;" 

is the correct format for your connection string.

Check out http://www.connectionstrings.com/access-2007 for more info.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...