Access connection in Connect Edition

We're trying to adapt some vba scripts to Microstation Connect Edition.

One does an Microsoft Access Database import / export.

In SS4 we're establishing a connection to an access database with the following code

Set MyDBcon = New ADODB.Connection
MyDBcon.CursorLocation = adUseClient

'db connection
On Error GoTo Error_Connection
MyDBcon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + stMyDbFileLocal, "", ""
On Error GoTo 0

This fails in CE.(The file which 'stMyDbFileLocal' points to exists.)

We have some references loaded in ss4 as you can see in the attached image.

Do we have to reference additional / other files to make this work in CE?

Ingo

Parents
  • So for the curious:

    Just to get it running we had to change the connection string from line 1 to 2:

        strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & stMyDbFileLocal & ";"
        strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & stMyDbFileLocal & ";"
     
        On Error GoTo Error_Connection
        MyDBcon.Open strCon 
        On Error GoTo 0

    There still seems to be some converting in background before running the first time but at least it's running.

    Answer Verified By: Robert Hook 

Reply
  • So for the curious:

    Just to get it running we had to change the connection string from line 1 to 2:

        strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & stMyDbFileLocal & ";"
        strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & stMyDbFileLocal & ";"
     
        On Error GoTo Error_Connection
        MyDBcon.Open strCon 
        On Error GoTo 0

    There still seems to be some converting in background before running the first time but at least it's running.

    Answer Verified By: Robert Hook 

Children
No Data