Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing an Excel File
Message
From
02/10/2003 05:47:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/10/2003 04:21:47
Chris Hui
www.adv-plus.com
Kwun Tong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00834086
Message ID:
00834153
Views:
33
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform