ADO and memory limit? "Description: Not enough storage is available to complete this operation."
-
Hi I'm getting error while retrieving only a dataset <100k rows (~150MB estimate) - ran into this error: "Description: Not enough storage is available to complete this operation." After googling seems like it's related to memory (As supposed to disk space or SQL server) This is how I instantiate connection and command: ADOconn.conn = actxserver('ADODB.Connection'); ADOconn.conn.ConnectionString = connStr; ADOconn.conn.CursorLocation = 2; ADOconn.conn.ConnectionTimeout = xxx; ADOconn.conn.CommandTimeout = xxx; ADOconn.conn.Open; ADOconn.command = actxserver('ADODB.Command'); ADOconn.command.CommandTimeout = 0; ADOconn.command.CommandType = 4; ADOconn.command.ActiveConnection = ADOconn.conn; Any idea if there's a property on connection or command whereby max memory limit can be set? (And is there a default?) Thanks ADO Connection object http://msdn.microsoft.com/en-us/library/ms807027.aspx ADO Command object http://msdn.microsoft.com/en-us/library/ms675022(v=vs.85).aspx Microsoft SQL Server connection string http://www.connectionstrings.com/sql-server-2005
dev
-
Hi I'm getting error while retrieving only a dataset <100k rows (~150MB estimate) - ran into this error: "Description: Not enough storage is available to complete this operation." After googling seems like it's related to memory (As supposed to disk space or SQL server) This is how I instantiate connection and command: ADOconn.conn = actxserver('ADODB.Connection'); ADOconn.conn.ConnectionString = connStr; ADOconn.conn.CursorLocation = 2; ADOconn.conn.ConnectionTimeout = xxx; ADOconn.conn.CommandTimeout = xxx; ADOconn.conn.Open; ADOconn.command = actxserver('ADODB.Command'); ADOconn.command.CommandTimeout = 0; ADOconn.command.CommandType = 4; ADOconn.command.ActiveConnection = ADOconn.conn; Any idea if there's a property on connection or command whereby max memory limit can be set? (And is there a default?) Thanks ADO Connection object http://msdn.microsoft.com/en-us/library/ms807027.aspx ADO Command object http://msdn.microsoft.com/en-us/library/ms675022(v=vs.85).aspx Microsoft SQL Server connection string http://www.connectionstrings.com/sql-server-2005
dev
A dataset requires approximately ten times the space of the actual data (give or take a lot). So if you're running a 32 bit application I would not be surprised if you hit the 2 GB program limit. Can you use a datareader instead and page the data? Or store the data more efficiently in a collection instead of a dataset?