Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing an Excel File
Message
De
02/10/2003 05:47:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/10/2003 04:21:47
Chris Hui
www.adv-plus.com
Kwun Tong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00834086
Message ID:
00834153
Vues:
32
>Hi Jos,
>
>Hm... I tried to import 10001 and 65xxx records. Both encountered the same error.
>
>That's alright. Thanks for your reply anyhow. :)
>
>So, do you know if there is any easy way to import an CSV file to a VFP cursor, given that I didn't know how many column I will have in the CSV file at design time?
>(so I cannot use APPEND FROM. Actually, APPEND FROM is encountering the same 10000 records error that IMPORT has)
>
>
>Regards,
>Chris Hui
lcCSV = 'myCSV.csv'
ALines(arrLines, FileToStr(lcCSV))
lcStruc = Strtran(arrLines[1],',',' c(254),')+' c(254)'
Create Cursor myCursor (&lcStruc)
Append From (lcCSV) type delimited
It's not a good idea to append from a CSV in fact. Instead you might try to automate excel :
#Define xlDBF3 8
oExcel=createobject('Excel.Application')
with oExcel
 .DisplayAlerts = .f.
 .Workbooks.Open('c:\mypath\myFile.xls')
 .ActiveWorkbook.SaveAs('c:\myTargetPath\myFile.dbf',xlDBF3)
 .Saved = .t.
 .Quit
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform