?
Solved

stored procedure

Posted on 1998-12-02
2
Medium Priority
?
236 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
[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 1

Accepted Solution

by:
kponder earned 80 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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
Suggested Courses

770 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