I am using c++ with ADO to connect to a mySql database, and I am using the standard ADO/C++ method to create a connection to the mySql database, and recordset is the pointer to the retrieved first record
_RecordsetPtr recordset;
recordset->Open("Select * from table",p_connection_.GetInterfacePtr(),adOpenForwardOnly,adLockReadOnly,adCmdText);
My concern is if the table contains too many records, and if I query all records, it will consume alot of memory?
I want to only retrieve, maybe 100 records each time and process them. Is it possible? The table does not contain id or index as its attribute, so “Select * from table where id >= 1 and id <= 100” does not work.
You will want to use limits on the query and cycle through them.
Note that if you are not using a database that starts its records off at 1 you will have to modify that algorithm a bit.