Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I'm trying to perform an SQL-query (AdoDB recordset) which would assign 30 columns x 108 000 rows of data into a variant. I get "Not enough storage is available to complete this operation"-error. I have 4 GB of RAM in my computer, running 32-bit version of Office 2010 in Windows 7 Professional and I run basically nothing on my computer at the same time. Shouldn't that be enough memory to handle like 3 million elements - even if one element would take couple of hundred kilobytes? And that's not even the case here, I have 29 of those columns full of ones and zeros, so pretty much only a bitmap.
How do I create more memory for Excel to use?
edit. Here's the AdoDB part of my code:
One way to solve this would be if I could create somehow a string that is 600 000 characters long and use that in SQL "IN"-operation. Is Excel VBA ok with 600 000 character strings?
How do I create more memory for Excel to use?
edit. Here's the AdoDB part of my code:
Code:
'Määritetään lähde
strProv = "Provider=Microsoft.ace.oledb.12.0;"
strDataSrc = "Data Source=" & strFullOstoAineistoFile & ";"
strSrcTable = "FROM [Ostoaineisto$] "
strXPro = "extended properties=excel 12.0"
Application.StatusBar = "Haetaan ostoaineistoa"
'Create the connection string
strConnect = strProv & strDataSrc & strXPro
strSelect = "SELECT * "
strSQL = strSelect & strSrcTable
Set rsData = New ADODB.Recordset
rsData.Open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly, adCmdText
'Check to make sure we received data
If Not rsData.EOF Then
vOstoAineisto = rsData.GetRows(rsData.RecordCount) 'TransposeArray(rsData.GetRows(rsData.RecordCount))
End If
'Clean up our recordset object.
rsData.Close
Set rsData = Nothing
One way to solve this would be if I could create somehow a string that is 600 000 characters long and use that in SQL "IN"-operation. Is Excel VBA ok with 600 000 character strings?
Last edited: