ACC1x: How to Find Attached Table's Database Name |
Q109725
This article describes how to use the FindFirst method on a dynaset of the MSysObjects table to find the path and filename of the database that contains an attached table.
The following example demonstrates how to use the FindFirst method to
find the path and filename of the database that contains an attached
table:
'********************
' MODULE DECLARATIONS
'********************
Option Explicit
Function AttachedDBName (TableName As String)
Dim DB As Database
Dim DS As Dynaset
Set DB = CurrentDB()
Set DS = DB.CreateDynaset("MSysObjects")
DS.FindFirst "[name] = '" & TableName & "'"
If Not DS.NoMatch Then
AttachedDBName = DS![database]
Else
AttachedDBName = ""
End If
End Function Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 4, "Importing, Exporting, and Attaching," pages 60-72
Keywords : kbprg
Issue type : kbhowto
Technology :
|
Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |