Access Linked table creation

B

brendan walsh

I'm using vb.net and actually am using ADOX 2.7 so I can
create an empty access db (working fine) then create
linked tables. I "thought" i did this before and found
references to this working but it barks and says the
properties are read only. is there a problem with the
following? How could I fix?

Thanks

tbl = New ADOX.Table()
With tbl
'// general properties
.Name = colTables(i)
.ParentCatalog = cat

'// extended properties (PROBLEM)
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Provider String")
= "Provider=ODBC;DSN=" & colTables(i) ' dsn
.Properties("Jet OLEDB:Remote Table Name") =
colTables(i)

'// append it
cat.Tables.Append(tbl)
 
P

Paul Clement

¤ I'm using vb.net and actually am using ADOX 2.7 so I can
¤ create an empty access db (working fine) then create
¤ linked tables. I "thought" i did this before and found
¤ references to this working but it barks and says the
¤ properties are read only. is there a problem with the
¤ following? How could I fix?
¤
¤ Thanks
¤
¤ tbl = New ADOX.Table()
¤ With tbl
¤ '// general properties
¤ .Name = colTables(i)
¤ .ParentCatalog = cat
¤
¤ '// extended properties (PROBLEM)
¤ .Properties("Jet OLEDB:Create Link") = True
¤ .Properties("Jet OLEDB:Link Provider String")
¤ = "Provider=ODBC;DSN=" & colTables(i) ' dsn
¤ .Properties("Jet OLEDB:Remote Table Name") =
¤ colTables(i)
¤
¤ '// append it
¤ cat.Tables.Append(tbl)

You need to refresh the link after appending the Table to the Tables collection. See the following:

PRB: ADOX Creates Read Only Linked Tables to Access Databases
http://support.microsoft.com/default.aspx?scid=kb;en-us;276035&Product=ado


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top