MartyConnelly
martyconnelly at shaw.ca
Wed Feb 23 20:39:34 CST 2005
'verify if current path is correct for tblStudent
debug.print DLookup("[Database]", "msysObjects", "[Name] = 'tblStudent'")
See if this gives you correct path for linked table
David Emerson wrote:
> 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
>
--
Marty Connelly
Victoria, B.C.
Canada