Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert Foxpro table to Access
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00728795
Message ID:
00728812
Vues:
26
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform