sportsguy
Finance wiz, Access hack
- Local time
- Today, 02:33
- Joined
- Dec 28, 2004
- Messages
- 363
code Fails at appending new table to catalog,
i am missing something, don'tknow what though,
thanks in advance,
sportsguy
what am i missing??
oh, and i shouldn't see the table in the db container either, correct?
i am missing something, don'tknow what though,
thanks in advance,
sportsguy
Code:
Private Const strProvider As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
Private Sub ADOLinkProjMaster_DblClick(Cancel As Integer)
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
cnn.Open strProvider & "F:\PROJMASTER.mdb"
Debug.Print cnn.ConnectionString
Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
Dim tblLink As ADOX.Table
Set tblLink = New ADOX.Table
' Open the catalog.
cat.ActiveConnection = cnn
With tblLink
' Name the new Table and set its ParentCatalog property to the
' open Catalog to allow access to the Properties collection.
.Name = "PROJMSTR"
Set .ParentCatalog = cat
' Set the properties to create the link.
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Datasource") = strProvider & "F:\PROJMASTER.mdb"
.Properties("Jet OLEDB:Remote Table Name") = "PROJMASTER"
End With
' Append the table to the Tables collection.
cat.Tables.Append tblLink
Set cat = Nothing
End Sub
what am i missing??
oh, and i shouldn't see the table in the db container either, correct?
Last edited: