Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

connecting oracle

Posted on 1998-07-22
5
Medium Priority
?
234 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
  • 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 300 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

916 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