I have a strange problem.
I am using a TQuery to retrieve a recordset (1772 records).
I need to loop thru this recordset and retrieve values from other tables using the recordset-values.
For this purpose I use a second TQuery.
qry1 = first recordset
qry2 = sub query
while not qry1.eof
//do some work, store some field in a string
//then based on the value from field 'X' retrieve other values
qry2.SQL.Append('the sql statement');
if qry2.RecordCount=1 then
//add some values to my big string
//write the big string to a textfile
This didn't work at first because the BDE reported "Insufficient memory". But using this q (http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20304916.html?query=insufficient+memory&topics=85
), that problem is solved.
Now another error occurs, but without any good debug information. The error is "access violation at...".
The strange thing is that when I read the first 114 records and run the loop, it works fine.
But any number above, it fails.
Can anybody help me?
Am I doing this wrong?