SQlRecCount and parameters

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alienjohn
Posts: 1
Joined: Tue 30 Mar 2021 16:01

SQlRecCount and parameters

Post by alienjohn » Tue 30 Mar 2021 17:54

Hello,
I am using trial o IBDAC and try to make some simple test task as this one :

I have a TIBCQuery with a SQL text :
SELECT FullName, Phone, Address, Type FROM Contacts WHERE Type :ParType
Field “Type” has values 1 = Customer, 2 = Supplier, 3 = Contact ,so ParType gets values from 1-3. I display the records in a grid, so far OK.
I need to get RecordCount for type = 1 (customers) and the grid is showing record results from type =2 (Suppliers)
when the RecordCount is executed the grid is showing the result from type = 1 (Customers) .

Note that the SQlRecCount text is the same as above and property QueryRecordCount = True. Before I execute the
TIBCQuery.RecordCount I pass the parameter as 1 (Customers).

Is there something that I missing or do I need to create a new query for that, to pass a diffrent parameter?

Thank you,
John

abak
Posts: 29
Joined: Sat 18 Oct 2014 18:42

Re: SQlRecCount and parameters

Post by abak » Fri 02 Apr 2021 08:41

Hello John,

Not sure that i understand you. But want to notice a missing in your sql (=) :

Code: Select all

.  WHERE Type =:ParType  

oleg0k
Devart Team
Posts: 185
Joined: Wed 11 Mar 2020 08:28

Re: SQlRecCount and parameters

Post by oleg0k » Wed 07 Apr 2021 16:33

Hello,
Unfortunately, the information you provided is insufficient for us to reproduce the issue.
Please send us an example that uses IBDAC and demonstrates the incorrect behavior, along with DDL scripts for creating and populating the database objects (or the backup file/database file).
Please send them to us through the form: https://devart.com/company/contactform.html

wbr, Oleg
Devart Team

Post Reply