Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resfeshlink

Status
Not open for further replies.

valjah

Programmer
Aug 1, 2005
11
Can someone please help me with this problme. Thanks in advance. My ReattachTables routine works to reattach the tables if the database is stored locally on my computer. However, if the database is stored on the network drive say H: the refreshlink does not work, and the tables are not reattached/linked. here is my code:

Function ReattachTables() As Variant

On Error GoTo Reattach_Err

'Restores table attachments, using the specified back-end database

Dim myDB As Database, tmpTable As TableDef
Dim i As Integer
Dim lpDBName As String

Set myDB = DBEngine(0)(0)

lpDBName = "H:\Management\Data\Plus\plusdb.mdb"




For i = 0 To myDB.TableDefs.Count - 1
Set tmpTable = myDB.TableDefs(i)
If tmpTable.Connect <> "" Then
tmpTable.Connect = ";DATABASE=" & lpDBName
tmpTable.RefreshLink
End If
Next i

ReattachTables = True

Reattach_Exit:
Exit Function

Reattach_Err:
MsgBox Error$
Resume Reattach_Exit


End Function
 
valjah,

Take a look here, thread181-1097317. It deals with the same issue.
 
Thanks a lot for this I will try it!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top