Solved

stored procedure

Posted on 1998-12-02
2
233 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
ID: 1447919
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
ID: 1447920
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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 84
Spell Check in VB6 13 137
VB6 ListBox Question 4 56
vbModal 12 66
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

749 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