?
Solved

Numeric datatype?

Posted on 2003-03-06
2
Medium Priority
?
223 Views
Last Modified: 2010-05-01
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
Comment
Question by:jk_nj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 400 total points
ID: 8080941
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
 

Author Comment

by:jk_nj
ID: 8081114
Thanks Tim ...You da man!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question