Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009

    Type mismatch error when opening the connection object


    I am trying to write some records into an access database. Following is the code:

    Dim MyConn As ADODB.Connection
    Dim WSRecSet As ADODB.Recordset
    Dim OBRecSet As ADODB.Recordset
    Dim ConfigItemRecSet As ADODB.Recordset

    'Dim Ocmd As ADODB.Command
    Dim strConn As String
    Dim strSQL As String
    strConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=build_monitor.mdb;DefaultDir=C:\Docum ents and Settings\test\My Documents\test_build;UID=Admin;PWD=;"

    Set MyConn = New ADODB.Connection
    MyConn.ConnectionString = strConn
    'Ocmd.ActiveConnection = MyConn.ConnectionString

    The last line gives a runtime 13 error. I don't know what the problem is.

    In my program I have set a reference to MS ActiveX Data Objects 2.8 library.

    Thanks in advance,

  2. #2
    Join Date
    Mar 2009
    Odbc Driver for Access
    StrConn = "Driver={Microsoft Access Driver (*.mdb)};" _
    & "DBQ=C:\Documents and Settings\test\My Documents\test_build\build_monitor.mdb;" _
    & "UID=Admin;PWD=;"

  3. #3
    Join Date
    Mar 2009
    Thanks, but this did not help. I had to resort to DAO objects.


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-28-2009, 03:31 PM
  2. Database Connection Error
    By pgabell in forum Access
    Replies: 1
    Last Post: 01-17-2009, 07:24 AM
  3. Error opening DLL
    By rhodesengr in forum Access
    Replies: 0
    Last Post: 10-29-2007, 11:47 AM
  4. "Type Mismatch" Error
    By elmousa68 in forum Access
    Replies: 2
    Last Post: 12-05-2006, 08:28 AM
  5. Replies: 0
    Last Post: 05-24-2006, 09:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Other Forums: Microsoft Office Forums