INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

(Oracle) Stored Proc returning rst back to VB6

(Oracle) Stored Proc returning rst back to VB6

(OP)
I have this simple Stored Procedure in Oracle:

CODE

CREATE OR REPLACE PROCEDURE ANDY_LETTINGS
(lettings_recordset OUT SYS_REFCURSOR)
AS
BEGIN
  OPEN lettings_recordset FOR
    SELECT DISTINCT SOME_FIELD
    FROM TABLEA
  END ANDY_LETTINGS;
/ 

And I even granted myself an EXECUTE on this procedure

Now I have this code in my VB6 application:

CODE

Dim cmdMine As New ADODB.Command
Dim rsMine As New ADODB.Recordset

cmdMine.ActiveConnection = Cn 'This is my connection
cmdMine.CommandTimeout = 300
cmdMine.CommandType = adCmdStoredProc
cmdMine.CommandText = "ANDY_LETTINGS"

Set rsMine = cmdMine.Execute  'Here is the problem 

This last RED line gives me an error:
PLS-00306: wrong numbers or types of arguments in call to 'ANDY_LETTINGS'
ORA-06550:line 1, column 7

This Stored Procedure works just fine from VB.NET.
What am I doing wrong in VB6? Any ideas...?

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: (Oracle) Stored Proc returning rst back to VB6

(OP)
I tried your suggestion, and got an error on the same red line:
PLS-00103: Encountered the symbol "ANDY_LETTINGS" when expected one of the following:
.(*@%=-+</> at in is mod ...... sad

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: (Oracle) Stored Proc returning rst back to VB6

(OP)
It looks like if I log into Oracle as a schema owner, I can execute a simple Stored Procedure (as long as it does not return any recordset). Granting myself an Execute does not allow me to run SP - strange...

Have fun.

---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close