I am using ADO in VB6 to call a stored procedure in SQL2005. The stored procedure is looking for data as "decimal(6,5)". My data is a double in VB6. In VB6, I tried setting up the call as follows (This is right out of an ADO book):
After doing a trace, the number I passed -0.03125 is converted in the trace to -312.
In another forum, they told me that this is because NumericScale and Precision are enumerated types correspond to adDouble and adCurrency.
I don't know which is correct. The way ADO converted the data it sent to SQL, I'd assume that the enumerated explanation is correct. If that's true, how can I get it to be sent to SQL correctly?
Code:
SQLCommand.Parameters.Append .CreateParameter("@Offset", adDecimal, adParamInput, , dMyDoubleValue)
SQLCommand.Parameters("@Offset").Precision = 6
SQLCommand.Parameters("@Offset").NumericScale = 5
After doing a trace, the number I passed -0.03125 is converted in the trace to -312.
In another forum, they told me that this is because NumericScale and Precision are enumerated types correspond to adDouble and adCurrency.
I don't know which is correct. The way ADO converted the data it sent to SQL, I'd assume that the enumerated explanation is correct. If that's true, how can I get it to be sent to SQL correctly?