visionetv
asked on
Query results won't display in DBGrid using variable parameters
Hi Experts;
Using a Delphi 7 ADOQuery component my application displays data results using hard-coded values in the Query but apparently will not recognize the same values as variables converted to integers from two TEdit controls
Code snippet - OnClick Event...
Query1.Parameters.ParamByN ame('RegID ').Value := StrToInt(Edit1.Text);
Query1.Parameters.ParamByN ame('BatNu m').Value := StrToInt(Edit2.Text);
Query1.Open;
Code snippet from Query:
WHERE TenderEntry.BatchNumber = :BatNum AND Batch.RegisterID = :RegID
With the Parameters 'BatNum' and 'RegID' in Query1 no results are displayed in the Delphi DBGrid.
Using hard-coded values without Parameters the results display without issue.
Code snippet from Query:
WHERE TenderEntry.BatchNumber = 1 AND Batch.RegisterID = 1
I need help in getting the Query to recognize the variable parameters from the TEdit boxes.
Any thoughts or a solution will be greatly appreciated.
Thank you,
Visionetv
Using a Delphi 7 ADOQuery component my application displays data results using hard-coded values in the Query but apparently will not recognize the same values as variables converted to integers from two TEdit controls
Code snippet - OnClick Event...
Query1.Parameters.ParamByN
Query1.Parameters.ParamByN
Query1.Open;
Code snippet from Query:
WHERE TenderEntry.BatchNumber = :BatNum AND Batch.RegisterID = :RegID
With the Parameters 'BatNum' and 'RegID' in Query1 no results are displayed in the Delphi DBGrid.
Using hard-coded values without Parameters the results display without issue.
Code snippet from Query:
WHERE TenderEntry.BatchNumber = 1 AND Batch.RegisterID = 1
I need help in getting the Query to recognize the variable parameters from the TEdit boxes.
Any thoughts or a solution will be greatly appreciated.
Thank you,
Visionetv
The query runs with error or just doesn't return rows?
ASKER
Query run without error, just won't display data in DBGrid. Hard-coded variables display without a problem
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Value in the DB was the problem not the code.