[AccessD] Relinking Foxpro Tables

David Emerson newsgrps at dalyn.co.nz
Wed Feb 23 18:44:25 CST 2005


Here is what I have so far.

Public Function basCheckLinksFS()

     Dim mdb As DAO.Database, mtbl As TableDef, strDataPath As String, 
strNewConnect As String

     Set mdb = CurrentDb

     strDataPath = "d:\CLIENTS\PM SERVICES\DATA\20050216"
     strNewConnect = "ODBC;DSN=Visual FoxPro Tables;SourceDB=" & 
strDataPath & 
";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;;TABLE="

     For Each mtbl In mdb.TableDefs
         'Only check this table link if this table IS linked.
         If InStr(mtbl.Connect, "DSN=Visual FoxPro Tables") <> 0 Then
             mtbl.Connect = strNewConnect & mtbl.Name
             mtbl.RefreshLink
         End If
     Next

End Function


The problem is with the refreshlink command near the end.  It returns error 
3011 - The Microsoft Jet database engine could not find the object 
rs2YTD.  I know that the strDatapath is correct and the foxpro dbf file is 
in the folder.

David




More information about the AccessD mailing list