By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

Determining the file location of the back-end

P: n/a
I know how to determine the file location of the current Access
database in VBA. But I'm trying to figure out how to determine the
file location of my back-end. Anybody know how I can call up the path
& name of the .mdb with my tables in it -- from a module in my front-
end?
Jul 22 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
See if this little piece of code helps:

Public Function ShowTables()
Dim I As Integer
With CurrentDb
For I = 0 To .TableDefs.COUNT - 1
If Len(Trim(.TableDefs(I).Connect)) 0 Then
Debug.Print .TableDefs(I).Connect
Debug.Print .TableDefs(I).SourceTableName
End If
Next
End With
End Function
evenlater wrote:
>I know how to determine the file location of the current Access
database in VBA. But I'm trying to figure out how to determine the
file location of my back-end. Anybody know how I can call up the path
& name of the .mdb with my tables in it -- from a module in my front-
end?
--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200807/1

Jul 22 '08 #2

P: n/a
"evenlater" <ev*******@gmail.comwrote in message
news:84**********************************@k37g2000 hsf.googlegroups.com...
>I know how to determine the file location of the current Access
database in VBA. But I'm trying to figure out how to determine the
file location of my back-end. Anybody know how I can call up the path
& name of the .mdb with my tables in it -- from a module in my front-
end?
CurrentDb.TableDefs("My Linked Table").Connect

will give you the path to the BE file.
Jul 22 '08 #3

P: n/a
That's what I'm looking for! Thanks!
Jul 22 '08 #4

P: n/a
evenlater wrote:
That's what I'm looking for! Thanks!
Couple of additional things to consider:

- most split apps have only one BE file but it is certainly possible to
link to tables in more than one BE file. Uncommon but just something to
be aware of.

- you'll want to ensure that the BE actually exists. No error is raise
when opening a FE with linked tables to a BE that doesn't exist - you'll
want to code for that possibility.

Good luck on the project!

--
'--------------------------
' John Mishefske
' UtterAccess Editor
' Microsoft MVP 2007, 2008
'--------------------------
Jul 23 '08 #5

P: n/a
John Mishefske <mi****@execpc.comwrote:
>- most split apps have only one BE file but it is certainly possible to
link to tables in more than one BE file. Uncommon but just something to
be aware of.
Indeed. I have have code in a few databases that, on startup, double checks that all
tables are linked to the same backend. Just belts and suspenders programming.
>- you'll want to ensure that the BE actually exists. No error is raise
when opening a FE with linked tables to a BE that doesn't exist - you'll
want to code for that possibility.
Another good point. This is as simple is opening a recordset based on a table
preferably with only a few records in it. If the open succeeds that all is well.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Aug 2 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.