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

Linked Table Manager

P: n/a
sj
I have written an application (CW.mde) with a seperate data (Data.mda)
file. My Data tables are linked to CW.

I want my user to be able to re-link the data.mda when they change
location/path of the data.mda. Hence, I have an button with the
following:

DoCmd.RunCommand acCmdLinkedTableManager

The button works on the computer with Ms Access but not those that on
runtime.

Does anyone has any experience how to make it work?

Alternatively, can anyone tell me how you link up user workstation (on
access runtime) to the data that is resided on the server?

Jul 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The Linked Table Manager is not a runtime feature. The links can be reset in
code and then you can use .RefreshLink to reestablish them. Code to choose a
file using the Windows Common Dialog can be found in
http://www.mvps.org/access/api/api0001 and code to relink can be found in
the Solutions9 sample database that you can download from
http://download.microsoft.com/downlo...a/bapp2000.exe.

Larry Linson
Microsoft Access MVP

"sj" <se*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I have written an application (CW.mde) with a seperate data (Data.mda)
file. My Data tables are linked to CW.

I want my user to be able to re-link the data.mda when they change
location/path of the data.mda. Hence, I have an button with the
following:

DoCmd.RunCommand acCmdLinkedTableManager

The button works on the computer with Ms Access but not those that on
runtime.

Does anyone has any experience how to make it work?

Alternatively, can anyone tell me how you link up user workstation (on
access runtime) to the data that is resided on the server?

Jul 5 '06 #2

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Access run-time doesn't have the Wizards (Link Table Manger is a
wizard) that the whole Access installation has. You have to write your
own code to link the data to the front-end (CW.mde). The following is a
routine I use to reconnect tables. Modify it to suit your needs.

Sub ReconnectMDBTables()

' This is the path to the data back-end.
' You can use a parameter to this Sub instead of this Const
' that has the path to the back-end.
Const DEV_PATH = "C:\Documents and Settings\mfoster\My " & _
"Documents\StockOptionExpensing\Access\" & _
"StockOptionAllocations_be.mdb"

Dim db As DAO.Database
Dim td As DAO.TableDef
Dim strPath As String
Dim strTable As String

Set db = CurrentDb
strPath = DEV_PATH

For Each td In db.TableDefs
If Left$(td.Name, 4) <"MSys" And _
Left$(td.Name, 1) <"~" Then
' Skip System & "deleted" tables.
' Only reconnect if the table is an Access attached table.
If Left$(td.Connect, 10) = ";DATABASE=" Then
' Drop & reconnect the linked table
strTable = td.Name
DoCmd.DeleteObject acTable, strTable
DoCmd.TransferDatabase acLink, _
"Microsoft Access", strPath, , strTable, strTable
DoEvents
Debug.Print "Reconnected: " & strTable
End If
End If
Next td

Debug.Print "Done"

exit_:
On Error Resume Next
Set td = Nothing
Set db = Nothing

End Sub

--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKwdrIechKqOuFEgEQLPDgCg29Ecfj3MGHzAvFB7ADR6W1 A0JqIAoJC2
fU7kixbPHKHQbtee7Ksy7gxv
=pmjE
-----END PGP SIGNATURE-----
sj wrote:
I have written an application (CW.mde) with a seperate data (Data.mda)
file. My Data tables are linked to CW.

I want my user to be able to re-link the data.mda when they change
location/path of the data.mda. Hence, I have an button with the
following:

DoCmd.RunCommand acCmdLinkedTableManager

The button works on the computer with Ms Access but not those that on
runtime.

Does anyone has any experience how to make it work?

Alternatively, can anyone tell me how you link up user workstation (on
access runtime) to the data that is resided on the server?
Jul 5 '06 #3

P: n/a
sj
hi mg,

i have changed the default to:
Const DEV_PATH = "C:\Program Files\CW\data.mde"

but it didn't work.

Btw, i don't understand the following codes:
If Left$(td.Name, 4) <"MSys" And _
Left$(td.Name, 1) <"~" Then
' Skip System & "deleted" tables.
' Only reconnect if the table is an Access attached table.
If Left$(td.Connect, 10) = ";DATABASE=" Then
could you elaborate?

thanks.

MGFoster wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Access run-time doesn't have the Wizards (Link Table Manger is a
wizard) that the whole Access installation has. You have to write your
own code to link the data to the front-end (CW.mde). The following is a
routine I use to reconnect tables. Modify it to suit your needs.

Sub ReconnectMDBTables()

' This is the path to the data back-end.
' You can use a parameter to this Sub instead of this Const
' that has the path to the back-end.
Const DEV_PATH = "C:\Documents and Settings\mfoster\My " & _
"Documents\StockOptionExpensing\Access\" & _
"StockOptionAllocations_be.mdb"

Dim db As DAO.Database
Dim td As DAO.TableDef
Dim strPath As String
Dim strTable As String

Set db = CurrentDb
strPath = DEV_PATH

For Each td In db.TableDefs
If Left$(td.Name, 4) <"MSys" And _
Left$(td.Name, 1) <"~" Then
' Skip System & "deleted" tables.
' Only reconnect if the table is an Access attached table.
If Left$(td.Connect, 10) = ";DATABASE=" Then
' Drop & reconnect the linked table
strTable = td.Name
DoCmd.DeleteObject acTable, strTable
DoCmd.TransferDatabase acLink, _
"Microsoft Access", strPath, , strTable, strTable
DoEvents
Debug.Print "Reconnected: " & strTable
End If
End If
Next td

Debug.Print "Done"

exit_:
On Error Resume Next
Set td = Nothing
Set db = Nothing

End Sub

--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRKwdrIechKqOuFEgEQLPDgCg29Ecfj3MGHzAvFB7ADR6W1 A0JqIAoJC2
fU7kixbPHKHQbtee7Ksy7gxv
=pmjE
-----END PGP SIGNATURE-----
sj wrote:
I have written an application (CW.mde) with a seperate data (Data.mda)
file. My Data tables are linked to CW.

I want my user to be able to re-link the data.mda when they change
location/path of the data.mda. Hence, I have an button with the
following:

DoCmd.RunCommand acCmdLinkedTableManager

The button works on the computer with Ms Access but not those that on
runtime.

Does anyone has any experience how to make it work?

Alternatively, can anyone tell me how you link up user workstation (on
access runtime) to the data that is resided on the server?
Jul 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.