Solved

stored procedure

Posted on 1998-12-02
2
228 Views
Last Modified: 2008-02-01
When I am returning a data through output parameter from a stored procedure it is giving strange problems.
My code:
My stored procedure is:
use pubs
go

if exists(select name from sysobjects where name='Mytest' and type='p')
drop proc Mytest
go

create proc Mytest @param1 integer,@param2 integer output
as
select @param2=stor_id from sales where qty=@param1

My vb code is:

QSQL = "{ ? = call Mytest(?,?) }"
Set rdoqry = rdoCn.CreateQuery("", strSql)

rdoqry.rdoParameters(0).Direction = rdParamReturnValue

rdoqry(2).Direction = rdParamOutput
rdoqry(0).Direction = rdParamReturnValue

rdoqry.rdoParameters(1) = 5

rdoqry.OpenResultset (rdOpenStatic)
Dim temp As Integer
temp = rdoqry(2)

If rdoqry.rdoParameters(0) <> 0 Then
   MsgBox "Could not change"
End If

could you solve my problem or give me your style of writing code for problems like this?

Thanks,
Raj in christ.
0
Comment
Question by:rgodavarthi
2 Comments
 
LVL 1

Accepted Solution

by:
kponder earned 40 total points
Comment Utility
Try changing the line that reads
rdoqry.OpenResultset (rdOpenStatic)
to rdoqry.execute since this does not appear to return a result set

If this does not help, a more detailed description of the problems you are experiencing would be helpful
0
 

Author Comment

by:rgodavarthi
Comment Utility
Do me a favour:

Just give a samle code with a stored procedure having two parameters one for input and other for output.
Call this in the front end and get data from the output parameter.

Please do it for me.

Raj in christ.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now