-----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 ReconnectMDBTab les()
' 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:\Documen ts and Settings\mfoste r\My " & _
"Documents\Stoc kOptionExpensin g\Access\" & _
"StockOptionAll ocations_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.Connec t, 10) = ";DATABASE= " Then
' Drop & reconnect the linked table
strTable = td.Name
DoCmd.DeleteObj ect acTable, strTable
DoCmd.TransferD atabase acLink, _
"Microsoft Access", strPath, , strTable, strTable
DoEvents
Debug.Print "Reconnecte d: " & strTable
End If
End If
Next td
Debug.Print "Done"
exit_:
On Error Resume Next
Set td = Nothing
Set db = Nothing
End Sub
--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBRKwdrIechKq OuFEgEQLPDgCg29 Ecfj3MGHzAvFB7A DR6W1A0JqIAoJC2
fU7kixbPHKHQbte e7Ksy7gxv
=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.RunComman d acCmdLinkedTabl eManager
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?