Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

stored procedure

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 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