Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing Access tables
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00430572
Message ID:
00430672
Views:
10
>Sure.
>
>Set up an ODBC connection in windows to the access database.
>
>Then in FoxPro:
>

>local lnHandle, lcSQL, lnRetu
>
>lnHandle = sqlconnect() && Pick your connection from the dialog
>lcSQL = "select * from accesstable blah blah blah"
>lnRetu = sqlexec(lnHandle,lcSQL,xCursor)
>if allt(alias()) == "XCURSOR" AND lnRetu = 1
> copy structure to mytable.dbf
> *!* Make sure the field names are not more than 10 characters
> use mytable.dbf
> select xcursor
> scan
> scatter to memvar memo
> insert into mytable from memvar
> select xcursor
> endscan
>else
> return lnRetu
>endif

Eric - thanks for the reply and code. I'm a VFP neophyte and never worked nor am familiar with ODBC. Assuming the connection I set up is correct, when I run your program it chokes on the line
lnRetu = sqlexec(lnHandle,lcSQL,xCursor) with the error - Variable xCursor not found.
The Access table I'm trying to import is called Local.mde

Thanks again for the help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform