Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with a TIBQuery component

Posted on 2013-11-29
3
Medium Priority
?
387 Views
Last Modified: 2013-12-24
I have an application with a form on which I have a TIBQuery (and other TIB...) component named Query.
It is used everywhere I need to query the database (Firebird).
I use it since several years...
Now in some occasion (I don't know exactly when and why), it crashes on this :
Query.SQL.Clear
Error is : EIBClientError - Dataset open.
So I thought that somewhere else in my code, where I used the same Query, I forgot to do QUery.Close after Query.Open and processing to get result.
Without knowing where this was, I used this work around :
try
 Query.Close;
except
end;
This just before the Query.Clear but again it crashed exactly the same way
Help !
0
Comment
Question by:LeTay
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 2000 total points
ID: 39692355
Did you check if there is any under-process transaction before closing/clearing the SQL?
Try this one:
  if IBQuery1.Database.Connected then
    begin
      if not IBQuery1.Transaction.InTransaction then
        begin
          if IBQuery1.Active then
            begin
              IBQuery1.Close;
              IBQuery1.SQL.Clear;
            end
          else
            IBQuery1.SQL.Clear;
        end
      else
        ShowMessage('Wait for the current transaction to finish!!!');
    end;

Open in new window

0
 

Author Comment

by:LeTay
ID: 39694172
Will try that
But what is strange is that I have 8 "clients" running my application and two have now this problem permanently, when another has it from time to time.
Nothing "common" between them (same OS as mine and others)
0
 

Author Comment

by:LeTay
ID: 39694269
Hello jimyX
I will try your code
But what should my program do if the IBQuery1.Transaction.InTransaction is True in order to continue its normal operation (here, issue a Query ) ?
Thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question