Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 I'm looking. I also tried adding security parms with no difference:

User ID=Admin;password=; or

User ID=myid,Password=mypw;

(but I shouldn't need them anyway because I'm already logged on to my PC and that's where the H drive resides)

 

Thanks in Advance!

  • *Experts*
Posted

Make sure you don't 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 won't 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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...