[AccessD] Adding ADODB parameters

Joe Rojas JRojas at tnco-inc.com
Tue Jun 1 14:34:42 CDT 2004


Hi All,

Using an ADO command object to retrieve information from a SQL Server 7
stored procedure.
The command object has 3 OUTPUT parameters used to retrieve 3 values from
the stored procedure.

The command object parameters are set up as follows:
...
com3.Parameters.Append com3.CreateParameter("@CV", adDecimal, adParamOutput)
com3.Parameters("@CV").Precision = 10
com3.Parameters("@CV").NumericScale = 4

 com3.Parameters.Append com3.CreateParameter("@CP", adDecimal,
adParamOutput)
com3.Parameters("@CP").Precision = 10
com3.Parameters("@CP").NumericScale = 4

com3.Parameters.Append com3.CreateParameter("@SV", adDecimal, adParamOutput)
com3.Parameters("@SV").Precision = 10
com3.Parameters("@SV").NumericScale = 4
...

Precision and scale are set exactly the same as the stored procedure, which
is setup exactly the same as the table.

The SP runs perfectly. If I check the values in the parameters after the SP
runs, I get the desired values.

The problem is that if I tried to perform the calculation:
com3.Parameters("@CV") + com3.Parameters("@CP") + com3.Parameters

I get a type mismatch error. If I cast all 3 parameters to type Double
before the calculation, it works fine.

Can I not do this?

Thanks
JR



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.



More information about the AccessD mailing list