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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the path of the backend in a split database

Status
Not open for further replies.

ProgramError

Programmer
Mar 2, 2005
1,027
0
0
GB
For those who wish to lookup the path of the tables/backend/links in a split database use the following in the control source of a textbox.

=DLookUp("Database","MSysObjects","[flags] = 2097152")


If the location of the back end changes, use the link manager to re-link to the tables.



Hope this helps someone.


Ian Mayor (UK)
Program Error
Programming is 1% coding, 50% error checking and 49% sweat as your application bombs out in front of the client.
 
Another way is to look at the connect property:

Code:
    For Each tdf In db.TableDefs
        strConnect = tdf.Connect
        If Dir(Mid(strConnect, InStr(strConnect, "DATABASE=") + 9)) = "" Then
            'All is not well
            blnConnectError = True
        End If
    Next
 
the MSysObject is a hidden system table which includes a lot of very useful information...

I'd recommend everyone who's going to be doing any largeish project to have a look at it.

p.s. only select statements allowed on it

--------------------
Procrastinate Now!
 
The msys tables store lots of interesting information but they are not guarenteed to survive into new versions. I'm not sure they are still viable in Access 2007 or other future versions.

I generally use DAO expressions like:
[blue]Mid(CurrentDb.TableDefs("tblActivities").Connect,11)[/blue]

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I'd have thought there's be something similar in 2007, after all, the application itself needs to store and access this information somewhere...

--------------------
Procrastinate Now!
 
I'm sure the information is stored somewhere. The "msys..." tables aren't officially documented by MS for our use. They have been very reliable in most cases over many versions.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top