Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine path of backend database 1

Status
Not open for further replies.

48Highlander

Technical User
Feb 8, 2004
119
CA
How can I determine the path and name of the backend database (not in the same directory as the main program)?

Bill J
 
Code:
Public Function getBackEndPath(strLinkTableName As String) As String
    getBackEndPath = Mid(CurrentDb.TableDefs(strLinkTableName).Connect, 11)
End Function
strLinkTableName is the name of a linked table.
 
That uses DAO so you need a reference to DAO.
 
No DAO way...
Code:
Public Function getBackEndPath(strLinkTableName As String) As String
    getBackEndPath = DLookup("Database", "MSysObjects", "Name='" & strLinkTableName & "'"
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top