Solved

connecting oracle

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 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

12 Experts available now in Live!

Get 1:1 Help Now