Prepared Statement?

P

Phill

I have a Access frontend/SQL Server 2K backend. I am
calling a stored procedure to insert my records. My
problem is I don't know how to code it for decimal
parameters. The database field is defined as a float,
the stored procedure is expecting a decimal (I've also
tried numeric), and the VBA code creates the parameter as
decimal (also tried numeric). I get a precision error.
How do I code this? Here is my VBA code for the
parameter creation.


cmd2.Parameters.Append .CreateParameter( _
"@TOTAL_QUANTITY", adNumeric,
adParamInput, , rstDetails("TOTAL_QUANTITY"))
 
S

solex

Phil,

You may want to explicitly define a variable for the value argument and use
the adDouble constant for the parameter, for instance

Dim qty As Double

qty = rstDetails("TOTAL_QUANTITY").Value

cmd2.Parameters.Append .CreateParameter( _
"@TOTAL_QUANTITY", adDouble, _
adParamInput, , qty)

Regards,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top