Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linking Foxpro free tables using ODBC in Access 2000
Message
From
26/03/2001 20:38:29
 
 
To
All
General information
Forum:
Microsoft Office
Category:
Access
Title:
Linking Foxpro free tables using ODBC in Access 2000
Miscellaneous
Thread ID:
00488788
Message ID:
00488788
Views:
28
I am attempting to programatically link a number of Foxpro tables into an access database but can't get the code to work.
I have a system DSN set up for Foxtables1.
I am running Office 2000 Premium on Windows 2000
Doing a manual Get External Data, Link Tables works with no problem

Code is as follows:

Function linkfox()
Dim datapath, filepath, myname, filenam, dpoint, rv, ConnxStr

datapath = getpath() ' Returns directory containing tables
filepath = datapath & "\*.dbf"
myname = Dir(filepath) ' Retrieve the first entry.

Do While myname <> "" ' Start the loop.
dpoint = InStr(myname, ".")
filenam = Mid(myname, 1, CLng(dpoint) - 1) ' Strip off file extension
' Build the ODBC connect string
ConnxStr = "ODBC;DSN=FoxTables1;UID=;SourceDB=" & datapath _
& ";SourceType=DBF; _
& Exclusive=No; _
& BackgroundFetch=Yes; _
& Collate=Machine; _
& Null=Yes; _
& Deleted=No;; _
& TABLE=" & filenam

DoCmd.TransferDatabase acLink, "ODBC", ConnxStr, acTable, myname, filenam
myname = Dir ' Get next entry.
Loop
rv = SysCmd(acSysCmdClearStatus)
End Function

I would appreciate any suggestions.
Reply
Map
View

Click here to load this message in the networking platform