Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003

    Unanswered: ADO/Access connection problem

    I have a problem when connecting to a Access database using a vba plug-in made in Autocad 2000. I supposed that my problem is related to my secured Access file (MDW) that is setting the group security. I have tried a lot of variant way to connect my database but I am still stuck with it. Maybe someone could help me finding out what I am doing wrong or what should I do to fixed it. I am using the Access XP(2002) version on an XP platform with the ADO object.

    Here's what I have tried yet:
    strDBPath = "H:\GOD\Ing\Ing - BD Principale.mdb"
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
    "Data Source=" & strDBPath & "; " & _
    "User ID=" & UID & "; " & _
    "Password=" & PWD & "; "
    Set objADOConn = CreateObject("ADODB.Connection")
    objADOConn.Open strConn

    If Err = 0 Then
    Set FaireConnection = objADOConn
    Set FaireConnection = Nothing
    End If

    strNumero = "Select [Numéro de dessin].[tbl_Dessins_Mecaniques] " & _
    "From tbl_Dessins_Mecaniques;"

    Set rstNumero = CreateObject("adodb.recordset")

    this code is giving me the error at this line (when trying to set the recordset):

    rstNumero.Open strNumero, objADOConn, adOpenDynamic, adLockPessimistic

    Here's the error code:
    Record(s) cannot be read; no read permission on 'tbl_Dessins_Mecaniques'.

    Anybody knows about that. Thanks a lot!
    Last edited by Jayeff; 05-01-04 at 23:56.

  2. #2
    Join Date
    Sep 2003

    2nd try: Connection string Problem

    HI breeze76!
    I have try your connection string. It has almost work but I am still having one more problem. First, I have to tell you that my principal Access database is located on a network drive. If I am writing the DBQ paramater in the connection path as follows : f:\PrincipalDatabase.mdb, I am getting a 'err: -2147418113 Catastrophic error'. This not a very talkative error description.
    Anyway, I have tried to see if it could be fixed by putting the database on my local drive (c:\PrincipalDatabase.mdb), And it finally worked out. The only thing is that it has to write my info on my network DB. I have tried by creating a local database that links all tables from the database to my principal network database. This workaround does not work. Do you have another way to do this?

    Thanks a lot...

    P.S.: I have noticed that your are using the Vbscript way to write the string by using the Server argument in front of the createobject function. It is not working for me in VBA.

  3. #3
    Join Date
    Apr 2004
    Did you make sure that the proper permission are set to the network drive? Are you hosting your own site or is this an intranet site?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts