How to Link tables in ADO.NET

D

David

I Know how to Link a Table from One Access database to
another using ADO and ADOX. Here is my ADO, ADOX vb6
source code:
-----------------------------------------------------
Set catLocal = New ADOX.Catalog
catLocal.ActiveConnection = cnnToLocalAccessMDB

Set tblRemote = New ADOX.Table
With tblRemote
Set .ParentCatalog = catLocal
.Name = strLocalTableName
.Properties.Item("Jet OLEDB:Create Link").Value = True
.Properties.Item("Jet OLEDB:Link Datasource").Value =
strRemotePathFileMDB
.Properties.Item("Jet OLEDB:Remote Table Name").Value =
strRemoteTableName
end With

catLocal.Tables.Append tblRemote
 
M

Miha Markic

Hi David,

See the thread "relink access tables in vb.net code" started by cyrus on 2th
jan.
There is a good response from Paul Clement.
 
D

David

Thank you Miha;

This means that we still have to use the "old" ADO.dll's?
I had hoped for a class like solution 'System.Data...' in
dNET to elegantly help out...I heared ADO.NET is our
future...do I miss the point of moving to ADO.NET?

Thanks again for your speedy response.
David
 
M

Miha Markic

Hi David,

I don't think that ado.net is supposed to replace ADOX.
Not yet, at least :)
 
P

Paul Clement

¤ Thank you Miha;
¤
¤ This means that we still have to use the "old" ADO.dll's?
¤ I had hoped for a class like solution 'System.Data...' in
¤ dNET to elegantly help out...I heared ADO.NET is our
¤ future...do I miss the point of moving to ADO.NET?
¤
¤ Thanks again for your speedy response.
¤ David

There currently is no native support in ADO.NET for linking tables to an Access
database. Your current options are the COM based ADOX and DAO libraries.


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