Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Numeric datatype?

Everyone,

I am trying to run this stored procedure from VB that should give me a return value. I am having trouble because the return paramter in the stored procedure is a NUMERIC datatype in SQL Server. I am not sure how I am supposed to deal with that on the VB side of things...Any ideas?


Dim sSql As String
Dim iID As Integer
Dim cmd As New ADODB.Command
Dim prm1 As ADODB.Parameter
Dim prm2 As ADODB.Parameter

sSql = strTableOwner & ".spNumbers"
With cmd
    .ActiveConnection = ConnectHist.ActiveConnnectionHist
    .CommandType = adCmdStoredProc
    .CommandText = sSql
    .Parameters.Append .CreateParameter("prm1", adChar, adParamInput, 15, ID)
    .Parameters.Append .CreateParameter("prm2", adNumeric, adParamOutput, , iID)
    .Execute
    iID = cmd("prm2")
End With
0
jk_nj
Asked:
jk_nj
1 Solution
 
TimCotteeCommented:
Hi jk_nj,

Treat it as a double rather than an integer, numeric has a decimal component as does a double value.

Tim Cottee MCSD, MCDBA, CPIM
http://www.timcottee.tk 

Brainbench MVP for Visual Basic
http://www.brainbench.com

0
 
jk_njAuthor Commented:
Thanks Tim ...You da man!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now