Solved

connecting oracle

Posted on 1998-07-22
5
177 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 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now