Results 1 to 5 of 5

Thread: vb6 can execute own procedure but cannot execute package's procedure

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    21

    Unhappy vb6 can execute own procedure but cannot execute package's procedure

    hi, all

    I have a problem as describe on topic. please see my codes below ...

    Code:
    Dim CPw As New rdoQuery
        Set CPw.ActiveConnection = Cn
    
        QSQL = "{ CALL TEST(?) }"
    
        Set CPw = Cn.CreateQuery("", QSQL)
        CPw(0).Direction = rdParamOutput
    
        Set Rs = CPw.OpenResultset
        
        Prompt = "Return value from stored procedure is " & CPw(0) & "."
        Response = MsgBox(Prompt, , "Stored Procedure Result")
    with this code. it was executed successfully.

    Code:
    Dim CPw As New rdoQuery
        Set CPw.ActiveConnection = Cn
    
        QSQL = "{ CALL REFTEST.GETMYVAR(?) }"
    
        Set CPw = Cn.CreateQuery("", QSQL)
    
        CPw(0).Direction = rdParamOutput <<<< ERROR
    
        Set Rs = CPw.OpenResultset
        
        Prompt = "Return value from stored procedure is " & CPw(0) & "."
        Response = MsgBox(Prompt, , "Stored Procedure Result")
    but this code error : couldn't find item indicated by text. Following is my Package's procedure code ...

    Code:
    create or replace
    package body reftest 
    as 
    Procedure GetMyVar(theValue IN OUT NUMBER)
    Is
    Begin
      theValue := 10;  
    End;
    end;
    Please help ...

  2. #2
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: vb6 can execute own procedure but cannot execute package's procedure

    Firstly, is it possible for you to use ADO instead of RDO? Ado lets you define a parameter as Inputoutput instead of just output.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    21

    Re: vb6 can execute own procedure but cannot execute package's procedure

    Quote Originally Posted by abhijit View Post
    Firstly, is it possible for you to use ADO instead of RDO? Ado lets you define a parameter as Inputoutput instead of just output.
    Hi, abhijit

    thanks for replying. I knew that ADO is 100% better but It's my client code . I can't do anything with that . So I got to develop with RDO . So Sad

    Chatawat L.

  4. #4
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: vb6 can execute own procedure but cannot execute package's procedure

    Quote Originally Posted by ClOuD_Za View Post
    Hi, abhijit

    thanks for replying. I knew that ADO is 100&#37; better but It's my client code . I can't do anything with that . So I got to develop with RDO . So Sad

    Chatawat L.
    Hi,
    I do not know if RDO will support an INPUTOUTPUT parameter. Perhaps you want to read some documentation on RDO. If a param has been defined as InputOutput, your client object must also treat it as InputOutput.

    That's a general rule. I found this article on msdn, but it doesn't have everything you're looking for.
    Last edited by abhijit; Jul 22nd, 2011 at 11:22 AM. Reason: Added Link
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    21

    Re: vb6 can execute own procedure but cannot execute package's procedure

    Quote Originally Posted by abhijit View Post
    Hi,
    I do not know if RDO will support an INPUTOUTPUT parameter. Perhaps you want to read some documentation on RDO. If a param has been defined as InputOutput, your client object must also treat it as InputOutput.

    That's a general rule. I found this article on msdn, but it doesn't have everything you're looking for.
    As you can see in my above code. I'm using rdParamOutput , for INPUT OUTPUT parameter type , which has been test by myself with other 30+ Stored Procedured that it's 100% working with INPUT OUTPUT parameter type. So i think the problem is not at the parameter type.

    thanks for replying and suggestion

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width