Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ADO to populate Excel has 16k row limit
Message
De
04/08/2008 15:46:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Using ADO to populate Excel has 16k row limit
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01336326
Message ID:
01336326
Vues:
66
I'm using the procedure below to dump a cursor into Excel. I found this code on UT a while ago, and I admit I don't know much about using AdoDB recordsets.

I am finding there's a limitation of 16384 rows possible to load into a sheet with this, an naturally we've exceeded the limit. Is there something I can do to overcome that ?
Lparameters tcCursorName, toSheet, tcTargetRange
tcCursorName = Iif(Empty(m.tcCursorName),Alias(),m.tcCursorName)
tcTargetRange = Iif(Empty(m.tcTargetRange),'A1',m.tcTargetRange)
Local loConn As AdoDB.Connection, loRS As AdoDB.Recordset,;
	lcTempRs, lcTemp, oExcel
lcTemp = Forcepath(Sys(2015)+'.dbf',Sys(2023))
lcTempRs = Forcepath(Sys(2015)+'.rst',Sys(2023))
Select (m.tcCursorName)
Copy To (m.lcTemp)
loConn = Createobject("Adodb.connection")
loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+Sys(2023)
loConn.Open()

**
loRS = loConn.Execute("select * from "+m.lcTemp)
With toSheet
	For ix=1 To loRS.Fields.Count
		.Cells(1,m.ix).Value = Proper(loRS.Fields(m.ix-1).Name)
	Endfor
	.Range('A2').CopyFromRecordSet( loRS )
Endwith
loRS.Close
Jim Newsom
IT Director, ICG Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform