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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning TADO Parameter Values

Status
Not open for further replies.

BrianGooch

Programmer
Jun 17, 2010
13
GB
Hi All,

This isolates an explicit failure from my previous TADO posts.

Reminder: Delphi 2009, Firebird 1.5, Win32, driver MSDASQL, Firebird driver ODBC 2.0.0.148.

What is successful:
1. Retrieve from Server system tables SP parameter details via ADOQry1
2. Retrieve USERdata from Server SP via TADOCommand
3. ClientQry for INSERTing USER data: AddParameters from ADOQry1 to ClientQry - datatype, direction (changed from output to input), size,scale, precision, value=nil on creation (but assign 0 for it to work).

The failure occurs next, here:
4. Assign values from TADOCommand.Parameters (output) to ClientQry parameters (input).

Code that works as far as it goes: (a loop)

ClientQry.Parameters.Items.Value:= USERdata.FieldValues(USERdata.Fieldname);

// other combinations of syntax do no get as far as the next step
Parameter.Items[0] is a string which is assigned correctly.
Parameter.Items[1] is an integer which fails with the error message "cannot convert variant of type (OleStr) into type Double".
The assignment fails to continue and only the first parameter value has been assigned.

Apart from the fact that Parameter[1].DataType = ftInteger, Delphi is automatically trying to convert to an unwanted double.

I shall appreciate any comments on this strange event.
Thanking you in advance.

Kind Regards,
Brian Gooch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top