Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exporting large files to Excel
Message
De
09/07/2007 12:09:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/11/2004 15:14:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00960188
Message ID:
01238642
Vues:
16
>I´m trying to export a file to excell, but only 16383 records are in the output file.
>there are about 40000 records in total that should be exported
LOCAL oExcel
oExcel = Createobject("Excel.Application")
With oExcel
	.WorkBooks.Add
	.Visible = .T.
	VFP2Excel(_samples+'data\testdata.dbc','select * from customer',.ActiveSheet.Range('A1'))
Endwith

function VFP2Excel
	lparameters tcDataSource, tcSQL, toRange
	Local loConn As AdoDB.Connection, ;
		loRS As AdoDB.Recordset,;
		ix
	loConn = Createobject("Adodb.connection")
	loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+m.tcDataSource
	loConn.Open()
	loRS = loConn.Execute(m.tcSQL)

	FOR ix=1 TO loRS.Fields.Count
		toRange.Offset(0,m.ix-1).Value = PROPER(loRs.Fields(m.ix-1).Name)
		toRange.Offset(0,m.ix-1).Font.Bold = .t.
	ENDFOR
	toRange.Offset(1,0).CopyFromRecordSet( loRS )
	loRs.Close
	loConn.Close
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
Répondre
Fil
Voir

Click here to load this message in the networking platform