Jump to content
Xtreme .Net Talk

Recommended Posts

Guest boskomihic
Posted

Dim cn As New OleDb.OleDbConnection()
cn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Password"";User ID=Admin;Data " & _
"Source=D:\My Documents\Visual Studio Projects\Adresar\Adresar.mdb"
cn.Open()

 

When I run this code I receive this exception:

System.Data.OleDbException: Could not find installable ISAM. . .

 

Is there anyone how can tall me what�s wrong with this ConnectionString?

 

Thanks in advance!

Guest Cogen
Posted

I'm not sure about the method your using, but how about using ADO to connect to your datasource. You can do it with the following code ...

 

Dim cn As Connection
Set cn = New Connection

With cn
   .Provider = "Microsoft.Jet.OLEDB.4.0"
   .ConnectionString = "User ID=Admin;Password=;" & _
                       "Data Source=YOURPATH;" & _
                       "Initial Catalog=YOURTABLE"
   .Open
End With

 

Actually, if your using other methods in the same project, the you will need to prefix your objects with ado...

ADODB.Connection

Guest Cogen
Posted
huh? I'm pretty sure it will work in vb6. I put ADODB in front of the object incase he's using RDO or something else. Why, will my code not work? :( . I didn't test it.
Guest boskomihic
Posted

I suppose that this Cogen's example was VB6.

I need to do this in VB.NET

Guest Cogen
Posted
Yes, my example was using VB6. Sorry to both of you for the confusion. I've never seen VB.net code before, and therefore didn't recognize it as such.
Guest boskomihic
Posted

I find what was a problem.

When I cut out

Password="";

everything goes just fine

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...