Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delimited Text File with fields greater than 254 chars.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01312930
Message ID:
01363558
Vues:
21
>
>Something like this:
>
>
>lcfile=fullpath(your_TXT_file)
>
>sqlsetprop(0,'DispLogin',3)
>store SQLSTRINGCONNECT(;
>	'DefaultDir='+ADDBS(JUSTPATH(FULLPATH(lcfile)))+'\;'+;
>	'Driver={Microsoft Text Driver (*.txt; *.csv)}');
>	TO gnConnHandle
>	
>?SQLEXEC(gnConnHandle, 'SELECT * from '+justfname(lcfile), "tempcrs")
>=SQLDISCONNECT(0)
>
>sele 0
>use your_table
>APPEND from (DBF("tempcrs"))
>
>

Yuri,

I came across this message when looking on how to import data from a text file via ODBC. Your sample code works very well. Thank you. But I was wondering about something. In the text file from which I am importing, I set names of the fields as the top line. Then when I look at the structure of the cursor "TEMPCRS" all character fields are of type MEMO. Is this by design? I can deal with this since when I append into my table the value from MEMO goes into CHAR type field. But I was just wondering if I might be doing something wrong.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform