title: Create Linked Table in MS-Access DB on web server
body: <p>getting error when trying to create linked table in access DB on web server - error is on the <code>ADOX.Catalog</code> not sure if I need to inherit ADOX or how?</p>
  
  <p>error is:</p>
  
  <blockquote>
    <p>Compiler Error Message: BC30002: Type 'ADODB.Catalog' is not defined.</p>
  </blockquote>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, _
                          ByVal e As System.EventArgs) Handles Me.Load
  
              ''''''''''''''''''''''''''''''''''''''''''''''''''''
              Dim A As String = "e:\web\Training.mdb"
              Dim B As String = "e:\web\LeaveDB.mdb"
              Dim C As String = "UsersDataTbl"
              Dim D As String = "NewUsers"
  
              CreateLinkedAccessTable(A,B,C,D)
              End Sub             
  
  
              Sub CreateLinkedAccessTable(strDBLinkFrom As String, strDBLinkTo As String, strLinkTbl As String, strLinkTblAs As String)
  
                  Dim catDB As ADOX.Catalog
                  Dim tblLink As ADOX.Table
  
                  Set catDB = New ADOX.Catalog
                      ' Open a Catalog on the database in which to create the link.
                  catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; _
                  "Data Source=" &amp; strDBLinkFrom
  
                  Set tblLink = New ADOX.Table
                  With tblLink
                      ' Name the new Table and set its ParentCatalog property to the
                      ' open Catalog to allow access to the Properties collection.
                  .Name = strLinkTblAs
                  Set .ParentCatalog = catDB
  
                      ' Set the properties to create the link.
                  .Properties("Jet OLEDB:Create Link") = True
                  .Properties("Jet OLEDB:Link Datasource") = strDBLinkTo
                  .Properties("Jet OLEDB:Remote Table Name") = strLinkTbl
                  End With
  
                      ' Append the table to the Tables collection.
                  catDB.Tables.Append tblLink
  
                  Set catDB = Nothing
              End Sub
  </code></pre>