Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Billings, MT

    Unanswered: ADO Coding Problem

    I am trying to relink attached tables dynamically using the following ADO code in Access XP. However, when I try to compile the code I get a compile error ... user type not defined. What am I doing wrong?

    Public Function RelinkTables( _
    ByVal AccessFilePathName As String) As Boolean

    Dim cat As ADOX.Catalog
    Dim tbl As ADOX.Table

    On Error GoTo HandleErrors
    RelinkTables = False

    Set cat = New ADOX.Catalog
    Set cat.ActiveConnection = CurrentProject.Connection
    For Each tbl In cat.Tables
    If tbl.Type = "LINK" Then
    tbl.Properties( _
    "Jet OLEDB:Link Datasource").Value = _
    End If
    Next tbl
    RelinkTables = True

    Set tbl = Nothing
    Set tbls = Nothing
    Set cat = Nothing
    Exit Function

    MsgBox Err.Description, vbCritical, "RelinkTables"
    Resume ExitHere
    End Function

    Terry Hoffer

  2. #2
    Join Date
    Sep 2004
    it's a problem with your reference, you must add a reference to
    Microsoft ADO Ext. 2.6 for DDL and Security

Posting Permissions

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