display linked table path

B

Beth

I have a database front end that is linked to a another database for backend
data. I would like a text box in my form to display the path that the
tables are linked to currently. The tables are all linked to the same
backend database path. Users will be able to see the current path and then
be able to decide if that is the link they want or if they need to change
it. I have the code to make the change, but I don't know how to display the
current path.
I appreciate any help you can provide.
Thanks in advance,
Beth
 
B

Bruce M. Thompson

I have a database front end that is linked to a another database for backend
data. I would like a text box in my form to display the path that the
tables are linked to currently. The tables are all linked to the same
backend database path. Users will be able to see the current path and then
be able to decide if that is the link they want or if they need to change
it. I have the code to make the change, but I don't know how to display the
current path.

Try the following syntax against any one of the linked tables:

Mid(currentdb.TableDefs("MyLinkedTableName").Connect, 11)
 
J

Jeff Conrad

Hi Beth,

Try this:
Assuming text box to display path is named txtBackEndPath

Private Sub Form_Load()
Dim strBackendPath As String

strBackendPath = Right([CurrentDb].[TableDefs]("tblAnyTableInBE").[Connect], _
Len([CurrentDb].[TableDefs]("tblAnyTableInBE").[Connect]) - 10)

Me.txtBackEndPath = strBackendPath
End Sub

(Substitute "tblAnyTableInBE" with the name of any table in the back end.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top