Solved

connecting oracle

Posted on 1998-07-22
5
212 Views
Last Modified: 2011-09-20
how can i use an oracle stored procedure which returns
and accepts parameters,how to use the resultset of an oracle stored procedure using RDO
(i use most accessing queries also as stored procedures
 which accepts no parameters, is it advantageous to use such)
0
Comment
Question by:prabhakar_raja
[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
  • 3
  • 2
5 Comments
 

Author Comment

by:prabhakar_raja
ID: 1466453
Edited text of question
0
 

Author Comment

by:prabhakar_raja
ID: 1466454
Edited text of question
0
 

Author Comment

by:prabhakar_raja
ID: 1466455
Edited text of question
0
 
LVL 2

Accepted Solution

by:
vspeter earned 100 total points
ID: 1466456
Try out the following code - Basically, It display the output of the store procedure onto MS Flex Grid.

The stored procedure is just a straight select statment based on one parameter.

    Dim rdoCon As New rdoConnection
    Dim rdoQry As New rdoQuery
    Dim rdoRSet As rdoResultset
   
    Dim lsSQL As String
   
    Dim liCols As Integer
    Dim liRows As Long
    Dim liCounter As Integer
    Dim liCounter2 As Integer
   
    On Error GoTo cmdRunErr
   
    lsSQL = "{? = Call uspRetrieveCRC (?)}"
   
    rdoCon.Connect = "DSN=ODBC_DSN;"
    rdoCon.EstablishConnection rdDriverNoPrompt
   
    Set rdoQry.ActiveConnection = rdoCon
    rdoQry.SQL = lsSQL
   
    rdoQry(0).Direction = rdParamReturnValue
    rdoQry(1).Direction = rdParamInput
   
    rdoQry(1).Value = "6    "
   
    'rdoQry.Execute
    Set rdoRSet = rdoQry.OpenResultset(rdOpenFowardOnly, rdConcurReadOnly)
   
    If Not rdoRSet.EOF Then
   
        liCols = rdoRSet.rdoColumns.Count
       
        MSFGData.Cols = liCols + 1
        MSFGData.Rows = 101
       
        MSFGData.Row = 0
       
        '-- Display heading
        For liCounter = 1 To liCols
            MSFGData.Col = liCounter          
            MSFGData.Text = rdoRSet(liCounter - 1).Name
        Next

        '-- Display max 100 rows        
        For liCounter2 = 1 To 100
            MSFGData.Row = liCounter2
            MSFGData.Col = 0
           
            MSFGData.Text = liCounter2
           
            For liCounter = 1 To liCols
                MSFGData.Col = liCounter
               
                If IsNull(rdoRSet(liCounter - 1).Value) Then
                       MSFGData.Text = ""
                Else
                     MSFGData.Text = Trim(rdoRSet(liCounter -                                              1).Value)
                End If
            Next
           
            rdoRSet.MoveNext
           
            If rdoRSet.EOF Then
                Exit For
            End If
        Next
    End If
       
cmdRunErr:

    Dim err As rdoError
   
    For Each err In rdoErrors
        MsgBox err.Description
    Next err
   
    Set rdoQry = Nothing
    Set rdoCon = Nothing
    Set rdRSet = Nothing

Cheers,  -- Do code this line in your program
0
 
LVL 2

Expert Comment

by:vspeter
ID: 1466457
One more thing, Index  for MS Flex Grid and rdoResultSet starting from 0.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…

759 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