[AccessD] Adding ADODB parameters

Jim Lawrence (AccessD) accessd at shaw.ca
Tue Jun 1 20:45:52 CDT 2004


Hi Joe:

I believe even though you could perform a similar calculation, in the SP or
at the FE, performing such a process right in the communication process will
not work. There is no conversion functionality at that point.

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Joe Rojas
Sent: Tuesday, June 01, 2004 12:35 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Adding ADODB parameters


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.
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list