Access may have linked tables.
I want to determine what the linked tables address or file path is from my VB application. Any idea how I could get this?
Printable View
Access may have linked tables.
I want to determine what the linked tables address or file path is from my VB application. Any idea how I could get this?
if your using DAO then the TableDef object has two important properties.
Connect: is the path to whatever file your mdb is linked to usally it looks like this ";Database =C:\Folder\Filename.mdb".
SourceTableName: this is table name within the linked database.
I am using the OpenRecordset on a opened database:
Could you give me an example of how to us DAO to get what I need? Thanks frigginjerkCode:Dim dbMyDB As Database
Dim rsMyRS As Recordset
Set dbMyDB = OpenDatabase(frmEOIFINDERMAIN.txtReportsManager)
Set rsMyRS = dbMyDB.OpenRecordset("Directories", dbOpenDynaset)
This works grat for me. I us the Mid function to trim out the ";DATABASE=" character from the stringCode:Dim dbMyDB As Database
Dim rsMyRS As Recordset
Dim tbdef As TableDef
Set dbMyDB = OpenDatabase(frmEOIFINDERMAIN.txtReportsManager)
Set rsMyRS = dbMyDB.OpenRecordset("Directories", dbOpenDynaset)
Set tbdef = dbMyDB.TableDefs("BrokerCash")
LinkedTableString = tbdef.Connect
LinkedTableString = Mid(LinkedTableString, 11, Len(LinkedTableString))
frmEOIFINDERMAIN.txtLinkedTable.Text = LinkedTableString