I'm attempting to pass data into a Stored Procedure in a SQL Server database, however I get an error which states 'The Precision is Invalid'
Here's the code for for setting the variables
Set oDatabase = oDBInstance.GetSharedDatabase()
oDatabase.AddToParamList "@UniquePID", adInteger, 8, UniquePIDpm, adParamInput
oDatabase.AddToParamList "@ProjectStage", adVarChar, 50, cboProjectStage, adParamInput
oDatabase.AddToParamList "@Area", adVarChar, 100, cboArea, adParamInput
oDatabase.AddToParamList "@RevisedCycleTime", adInteger, 8, (cboRevisedCTHours * 60) + cboRevisedCTMins, adParamInput
oDatabase.AddToParamList "@RevisedSelectionRate", adInteger, 8, txtRevisedSelectionRate, adParamInput
oDatabase.AddToParamList "@RevisedCycleRate", adDecimal, 8, CDbl(lblRevisedCycleRate), adParamInput
oDatabase.ExecuteStoredProc ("[dbo].[InsertUpdateMetrics]")
If I remove the @RevisedCycleRate
parameter from the stored procedure and run the code without passing the decimal through the code runs fine and the SQL stored procedure runs (with the exception of adding the Revised Cycle Rate to the table).
I'm not sure what I'm doing wrong.
I'm at the point where I'm considering making the value a whole number by multiplying by 100 (it's a value with 2 decimal places) and passing it in as an Integer, then dividing by 100 within the stored procedure.
Any help is much appreciated.