C
Chav
Hello,
I am trying to create tables linked from one Access database into
another after uploading to a web server. My code looks like this:
Sub AddLinkedTable(tName, DBConn, LinkedDbPath, DBpassword)
set adoCat = Server.CreateObject("ADOX.Catalog")
set adoTbl = Server.CreateObject("ADOX.Table")
adoCat.ActiveConnection = DBConn
set adoTbl.ParentCatalog = adoCat
adoTbl.Name = tName
' the code breaks at the following line:
adoTbl.Properties("Jet OLEDB:Create Link") = True
adoTbl.Properties("Jet OLEDB:Link Datasource") = LinkedDbPath
adoTbl.Properties("Jet OLEDB:Link Provider String") = ";Pwd=" &
DBpassword
adoTbl.Properties("Jet OLEDB:Remote Table Name") = tName
adoCat.Tables.Append adoTbl
adoCat.Tables.Refresh
adoCat.Close
set adoTbl = nothing
set adoCat = nothing
End Sub
The IIS returns error message "ADODB.Properties error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal"
I looked into adoTbl.Properties.Count and it returns 0 as if the
Properties collection is empty.
Please, help.. I am stuck with this for a day.
I am trying to create tables linked from one Access database into
another after uploading to a web server. My code looks like this:
Sub AddLinkedTable(tName, DBConn, LinkedDbPath, DBpassword)
set adoCat = Server.CreateObject("ADOX.Catalog")
set adoTbl = Server.CreateObject("ADOX.Table")
adoCat.ActiveConnection = DBConn
set adoTbl.ParentCatalog = adoCat
adoTbl.Name = tName
' the code breaks at the following line:
adoTbl.Properties("Jet OLEDB:Create Link") = True
adoTbl.Properties("Jet OLEDB:Link Datasource") = LinkedDbPath
adoTbl.Properties("Jet OLEDB:Link Provider String") = ";Pwd=" &
DBpassword
adoTbl.Properties("Jet OLEDB:Remote Table Name") = tName
adoCat.Tables.Append adoTbl
adoCat.Tables.Refresh
adoCat.Close
set adoTbl = nothing
set adoCat = nothing
End Sub
The IIS returns error message "ADODB.Properties error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal"
I looked into adoTbl.Properties.Count and it returns 0 as if the
Properties collection is empty.
Please, help.. I am stuck with this for a day.