Error: 5 Security Error connecting to DB

MarkD

Active member
Joined
Mar 27, 2003
Messages
31
Location
Burlington, VT, USA
H-E-L-P! Having trouble getting onto 1st base. ADO.NET

Any ideas why I might be getting a Security Error code 5 trying the following code to open my database in VB.Net?

PCcon = New ADODB.Connection()
PCcon.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=H:\Access\VDS-prototype.mdb")

The database exists where Im looking. I also tried adding security parms with no difference:
User ID=Admin;password=; or
User ID=myid,Password=mypw;
(but I shouldnt need them anyway because Im already logged on to my PC and thats where the H drive resides)

Thanks in Advance!
 
Make sure you dont have the database open in Access when you run your program. I think the default method of opening a connection in Access is non-shared (exclusive). If you have it open in Access, it wont let you open it through .NET.

Otherwise it looks like a good connection string. If you want, you can use JUST "User ID=Admin;" - no need to specify the password, though you could use ";Password=;" if you want.

-Nerseus
 
Back
Top