hi, i would like to ask how can i link a table from a password protected access db?, help! thanks!, my code below works fine if its not protected but it has to be protected, thanks.
strDBLinkTo = Application.StartupPath & "\dbprmain.mdb"
strLinkTbl = "e201"
catDB = New ADOX.Catalog()
cnn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB
atabase Password=123; Data Source=" & strDBLinkFrom)
catDB.ActiveConnection = cnn
tblLink = New ADOX.Table()
With tblLink
.ParentCatalog = catDB
.Name = strLinkTblAs
.Properties("Jet OLEDB:Create Link").Value = True
.Properties("Jet OLEDB:Link Datasource").Value = strDBLinkTo
.Properties("Jet OLEDB:Remote Table Name").Value = strLinkTbl
End With
catDB.Tables.Append(tblLink)
catDB = Nothing
strDBLinkTo = Application.StartupPath & "\dbprmain.mdb"
strLinkTbl = "e201"
catDB = New ADOX.Catalog()
cnn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB
catDB.ActiveConnection = cnn
tblLink = New ADOX.Table()
With tblLink
.ParentCatalog = catDB
.Name = strLinkTblAs
.Properties("Jet OLEDB:Create Link").Value = True
.Properties("Jet OLEDB:Link Datasource").Value = strDBLinkTo
.Properties("Jet OLEDB:Remote Table Name").Value = strLinkTbl
End With
catDB.Tables.Append(tblLink)
catDB = Nothing
Last edited by a moderator: