Subject Re: [IBO] Re: Cannot Prepare a blank statement error
Author m. Th.
acathelp wrote:
> I went through and deleted or renamed all duplicate Rave Data Source components which are used to tie the data to the reports (there were about 3 which were duplicated), but I'm still getting the same result. The SysPrepareSQL code executes and I can get it to show me that SQL.Text is not blank, but then the report.execute runs which, for some reason, invokes the SysPrepareSQL function again, and this time the SQL.Text value is blank/empty. Is there any code within IBObjects which may be running prematurely to close the data connection or clear our the SQL component?

You must tell us! :-)

Did you have the appropriate stack trace?
I mean did you tried to put a breakpoint on your ShowMessage(SQL.Text)
comment and have a look at the stack trace? This might give a clue from
*where* SysPrepareSQL is called 2nd time. Also perhaps it's better to
post the stack trace here to have a look. (IIRC, you can copy/save the
stack trace if you use Delphi's integrated debugger). As an aside
perhaps is better to build your project with the debug DCUs of VCL in
order to have the complete image. Another thing worth investigating: Are
you sure that is the *same* SQL component which throws the error? Can
you put in your ShowMessage something like
ShowMessage(TComponent(Sender).Name+': '+SQL.Text)?

Another path is to use some debugging/logging tools (the ones from
JCL/JVCL are free and very nice) in order to pinpoint your problem. But
let's try first the official path using the integrated debugger.

HTH,

m. th.