Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Precision Error when creating parameter
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00675388
Message ID:
00675489
Vues:
27
Don't you have to give size when using decimal type:
.Parameters.Append .CreateParameter("@ReturnPercentNumb", adDecimal, adParamOutput,10,4)
>When I run the following code, I get an error message - "The precision is invalid". This must have something to do with the Decimal data type of the second output paramater.
>
>I haven't come across any examples of appending params to a Stored Procedure using the Decimal datatype. Any ideas on what I have to change in order to make this work ...
>
>
>Dim cmdMatched As New ADODB.Command
>    Dim dblTest As Double
>
>    With cmdMatched
>        .ActiveConnection = gobjDataAccess.objConn
>        .CommandType = adCmdStoredProc
>        .CommandText = "up_PercentageMatchedGLTrans"
>        .Parameters.Append .CreateParameter("@ReturnPercentChar", adVarChar, adParamOutput, 20)
>        .Parameters.Append .CreateParameter("@ReturnPercentNumb", adDecimal, adParamOutput)
>    End With
>
>   cmdMatched.Execute
>
>   dblTest = cmdMatched.Parameters("@ReturnPercentNumb")
>
>   Set cmdMatched = Nothing
>
>
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform