Solved

Problem with a TIBQuery component

Posted on 2013-11-29
3
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 500 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

617 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