I am going insane by this error that I cannot fix. I've spent a few weeks googling and trying various changes to the code. I EVEN tried debugging the goddamn thing in OLLY Debugger! But to no avail.
Summary of My Program:-
Connects to an MS-SQL database and extracts signatures & images of customers and dumps them to a .BMP file using the TDBImage control.
How I did it:-
Created a TQuery & a TDataSource object. The TDBImage uses the datasource and the datasource in turn uses the query. After the image is loaded into the TDBImage I use TDBImage.Picture.SaveToFile(file_name) to save to disk.
And the query uses a database from BDE Administrator of course
After the user clicks a 'Begin' button, I run a loop for all the data in the database and with every loop iteration, I execute an SQL statement using Query1.SQL='Select Image from ImageTable where SeqNo=' + inToStr(i), where 'i' is the loop variable of course.
In this way all the 15000 records of the database were supposed to be processed. But I get an 'Access Violation' error and an 'Invalid Pointer' error. Sometimes just one, sometimes both and sometimes my 'try' 'except' doesn't even catch the exception and the program exits silently.
I tried everything I could. I tried fastmemshare, machine level debugging, googled 'Access Violations' & 'Invalid Pointers', studied about Delphi's (@str-8)
string reference counts etc etc but I am very sad to say that I could not come up with a fix.
I have attached my program (very small just 8Kb) for reference.
If anyone could help me out, I would be very very grateful. Thanks in advance to anyone who can help me