ADDOB Connection Error

I've been testing to create a new access database using "ActiveX Data Objects Library" as following code, but myDB.Open ConnString string triggered continuous run-time error '3706' and it said Provider cannot be found. It may not be properly installed. Based upon this comment, the reference did not installed correctly.

Does anybody know what is the right version for this? I added "Microsoft ADO Ext. 6.0 for DDL and Security" reference for this procedure. 

Sub CreateDB3()
Dim myDB As New ADODB.Connection '** ADDOB Object
Dim dbLocation As String
Dim ConnString As String
dbLocation = "F:\VBA and VB.NET\Microstation VBA\Practice\Chapter-27\ActiveX\DatabaseLinkTest.mdb"
ConnString = "Provider=Microsoft.Jet.OLEDB.6.0:Data Source=" & dbLocation
myDB.Open ConnString
myDB.Execute "Create Table Expenses (mslink counter, " & _
"LotLink Long, Description Char(100), amount double)"
End Sub

 

 

 

  • you can use oracle connection.

    edit the username and password.

     

    Sub data_connect()
                    Set data_connection = New ADODB.Connection
                    data_connection.CursorLocation = adUseClient
                    data_connection.Open "Provider=MSDAORA.1;Password=ur_oracle_password;User ID=ur_oracle_username;Data Source=csdoracle;Persist Security Info=True"
    End Sub

     

    strQuery = "select max(to_number(point_no)) from table where point_no > 0"
    rst.Open strQuery, data_connection, adOpenDynamic, adLockOptimistic
     

  • Josh:
    ConnString = "Provider=Microsoft.Jet.OLEDB.6.0 : Data Source=" & dbLocation

    Typo! Check your ConnString. Colon is not a valid separator — you meant to write semi-colon.

    You will find other websites, that deal specifically with Microsoft technology, more useful than this one when discussing topics such as ADO.

    Farook:

    you can use oracle connection.

    It's kind of you to respond, but how does that help him connect to an Access database?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Thanks,

     I've made a bunch of typos whenever add more scripts damn it!