Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

connecting oracle

Posted on 1998-07-22
5
Medium Priority
?
228 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 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
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…

721 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