Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Foxpro table to Access
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00728795
Message ID:
00728812
Views:
25
>I need to convert a Foxpro table to access - waht is the best way of doing this?
>
>Colin Northway

Here's some code that might get you started if you can't find a prepackaged tool...
ln=SQLCONNECT('dbtest')

USE ? IN 0 ALIAS __table

SELECT __table

lnfields=AFIELDS(lafields)

lcSql = 'create table ' + SUBSTR(justfname(DBF()),1,AT('.',justfname(DBF()))-1) + ' ('
FOR i = 1 TO lnfields
	lcSql = lcSql + lafields(i,1) + ' '+IIF(lafields(i,2)='C','CHAR','')+'('+TRANSFORM(lafields(i,3))+'),'

NEXT i

lcSql = SUBSTR(lcSql,1,LEN(lcsql)-1) + ')'

MESSAGEBOX(lcsql)

SQLEXEC(ln,lcsql)

***Once the table is created... scan and do an insert
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform