Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ADO to populate Excel has 16k row limit
Message
From
04/08/2008 15:46:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Using ADO to populate Excel has 16k row limit
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01336326
Message ID:
01336326
Views:
65
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.
Next
Reply
Map
View

Click here to load this message in the networking platform