Results 1 to 5 of 5

Thread: Vb6, rdo and resultset from oracle

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    21

    Unhappy Vb6, rdo and resultset from oracle

    Hi, All

    I've been searching for the sample of how to retrieve resultset back from ORACLE ... I still got no clue . Following is my code .

    Please Help. Thank you so much in advance

    Chatawat L.

    ORACLE PART

    Code:
    create or replace package reftest 
    as 
    type empCur is ref cursor; 
    Procedure GetEmpData(En in VARCHAR2, EmpCursor in out empCur); 
    END;
    
    create or replace package body reftest 
    as 
    Procedure GetEmpData (EN in VARCHAR2, EmpCursor in out empCur) 
    is 
    begin 
     open EmpCursor for select ename, hiredate from emp where ename LIKE EN; 
    end; 
    end;

    VB6 PART

    Code:
    Option Explicit
    Dim Cn As rdoConnection
    Dim En As rdoEnvironment
    Dim CPw As rdoQuery
    Dim Rs As rdoResultset
    Dim Conn As String
    Dim QSQL As String
    Dim Response As String
    Dim Prompt As String
    
    Private Sub btnExecute_Click()
        CPw(0) = Text1.Text            ' Text1.Text = "ALLEN" <--------- ERROR : 40041 Couldn't find item indicated by text
        CPw.Execute
        
        Prompt = "Return value from stored procedure is " & CPw(1) & "."
        Response = MsgBox(Prompt, , "Stored Procedure Result")
    End Sub
    
    Private Sub Form_Load()
        Conn = "UID=scott;PWD=tiger;DSN=MY_DSN;"
    
        Set En = rdoEnvironments(0)
        Set Cn = En.OpenConnection("", rdDriverNoPrompt, False, Conn)
        QSQL = "{ call REFTEST.GETEMPDATA(?,?) }"
        Set CPw = Cn.CreateQuery("", QSQL)
    End Sub
    Last edited by ClOuD_Za; Jul 20th, 2011 at 03:26 AM.

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