Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The precision is invalid

Status
Not open for further replies.

williey

Technical User
Jan 21, 2004
242
I have the following code that gives me the "The precision is invalid". Tried varies way to call the stored procedure but all resulted in the same error.

Any ADO guru here want to chime in?

Code:
set oCmd = server.createobject("ADODB.Command")
with oCmd
	.ActiveConnection = oConn
	.CommandText = "stp_InsertNewRrSub"
	.CommandType = adCmdStoredProc
	.Parameters.Append .CreateParameter("rrollID", adDecimal, adParamInput, 8, mRRID)
        .Parameters("rrollid").Precision = 8
	.Parameters.Append .CreateParameter("annualbrent", adNumeric, adParamInput, 17, gAnnualBaseRent)
         .Parameters("annualbrent").Precision = 17
         .Parameters("annualbrent").NumericScale = 2
	 .Parameters.Append .CreateParameter("cmnts", adVarChar, adParamInput, 80, gCmnt)
	 .Parameters.Append .CreateParameter("mtm", adInteger, adParamInput, 1, gIsMTM)
	 .Parameters.Append .CreateParameter("vacant", adInteger, adParamInput, 1, gIsVacant)
	 .Parameters.Append .CreateParameter("occpdsf", adDecimal, adParamInput, 7, gLeasedSF)
         .Parameters("occpdsf").Precision = 7
	.Parameters.Append .CreateParameter("enddt", adVarChar, adParamInput, 16, gLeaseEndDt)
	.Parameters.Append .CreateParameter("startdt", adVarChar, adParamInput, 16, gLeaseStartDt)
	.Parameters.Append .CreateParameter("suite", adVarChar, adParamInput, 10, gSuiteNum)
	.Parameters.Append .CreateParameter("tentname", adVarChar, adParamInput, 50, gTenantName)			
	.Parameters.Append .CreateParameter("userid", adInteger, adParamInput, 8, getUserID())			
	.Parameters.Append .CreateParameter("rrollsubID", adDecimal, adParamOutput, 8, 0)
        .Parameters("occpdsf").Precision = 8
	.Execute


------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.
 
Be sure that the arguments defined in the actual stored procedure on the database match the parameters defined in the ADO Command object.
 
I found the problem. It is the declaration of precision of the last parameter. The naming of the field was wrong. I cut and paste from another parameter and forgot the change the name.

Ahhhh!!! so much time wasted. Thanks!

------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top