Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Fields to Delphi ADO Query

Status
Not open for further replies.

acabrera

Programmer
Jan 22, 2004
44
US
I am unable to add persistent fields to a Delphi ADO parameterized query. The SQL statement is:

SELECT CO_KEY, DETAIL_DATA1 FROM CONTACT_DETAIL
WHERE CONTACT_KEY IS NULL
AND DETAIL_CD = 'PHONE'
AND CO_KEY = :CO_KEY

The error message is 'Parameter object is improperly defined. Inconsistent or incomplete information was provided.'

The query works fine in BDE but not in ADO. Thanks for any help.
 
hi

Have you set the data type of the parameter in the query's properties?

lou

 
You need to set the data type, param type and (default) value properties of the parameter. If necessary, after you get the field definitions, you can delete whatever you put in the value.

-D
 
I fixed the problem yesterday by doing the ff:
1. remove the parameter clause (where co_key=:co_key) from the SQL statement
2. add the persistent fields (double click on ADO query object, right click, add all fields)
3. add the parameter clause to the SQL statement
4. in the code that creates the form, insert the
statement before the query is activated:
qryCompanyPhone.Parameters.ParamByName('CO_KEY').Value :=
qryActiveWkorder.FieldbyName('CO_KEY').AsString;
I read the suggestions about the data and param types but where do I set them in Delphi 5?
 
In the Object Inspector for the TADOQuery, there should be a property called "Params". Click on the elipse (...) button for that property and you'll see all of the params in the query and can set their data types, parameter types,
and default values.

-D
 
I followed the suggestions on the data type (ftInteger) and param type (pdInput) using the parameter collection editor (Thank you). But when I added the fields, the new error was 'not enough storage is available to complete this operation.' I got this error on both Delphi 5 and 7.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top