Getting the back end file path of a linked table

B

Byzantine

I'm trying to display the .Connect string on a single linked table in my MS
Access 2003 database (which will give me the full file name and path of the
back end file).

I currently have:

Dim td As dao.TableDef
Set td.Name = "tbl Configuration" ' the name of the linked table
Msgbox Mid(td.Name.Connect, 11)

This does not work.

Can anyone help me overcome my incompetence please ?

Any ideas/useful links are much appreciated.

Regards

Byz
 
B

Brendan Reynolds

Dim db As DAO.Database
Dim td As DAO.TableDef

Set db = CurrentDb
Set td = db.TableDefs("[tbl Configuration]")
Msgbox Mid(td.Connect, 11)

If you really have a space between 'tbl' and 'Configuration' in your table
name, you'll need the square brackets as in the example above. But if the
space was just a typo in the newsgroup post, you won't need the square
brackets.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
N

Nikos Yannacopoulos

Try something along the lines of:

strConnect = CurrentDb.TableDefs("tbl Configuration").Connect
MsgBox Mid(strConnect, 11)

HTH,
Nikos
 
Top