linked tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
In Access and using VB 6.
1) by using code, how can I tell if a table is linked
2) by code, how can I find the path of a linked table
3) by code, how can I tell what kind of DB the table is linked to, Access, SQL Server etc

thank
 
you can read .Connect property of tabledef, there you find answers for all 3
questions
 
mike w. said:
Hello,
In Access and using VB 6.0
1) by using code, how can I tell if a table is linked?
2) by code, how can I find the path of a linked table?
3) by code, how can I tell what kind of DB the table is linked to, Access, SQL Server etc?

thanks

If you use VB6 you don't have Linked Table...., you have probably
ADODC linked by OLEDB to your DB, or a Recordset connected
to it.

Reading your question i think you are using Access like Front End
and you work with VBA not VB6.
VBA is special Library of VB6 dedicated to Access/Word/Excel.

So in Access you have Linked Table.

1)SELECT MSysObjects.Name FROM MsysObjects _
'WHERE (Left$([Name],1)<>"~") AND (Left$([Name],4) <> "Msys") AND
(MSysObjects.Type)=1 _
'ORDER BY MSysObjects.Name;

This is SQL to put in a RecordsetSource, and return only the Linked Table
if exist the Recordset is not empty.

2)To read the path of Linked you need open Tabledef collection of Linked
and extract from Connect property the DATABASE string field.

3)The metod to Link Access(Table) or SQL_SERVER is not the same
but you can use ODBC_DIRECT giving to Connect property member
of Tabledefs(TableName) the right StringConnection.

You need to read Help is very clear about this.

@Alex.
 
Back
Top