Results 1 to 2 of 2

Thread: ADO and result sets

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    69

    ADO and result sets

    Can anyone tell me how to handle a resultset being returned when I use ado and ODBC to call a stored procedure.
    Below is the code I use to set up my parameters for the stored procedure.

    This stored procedure will return a resultset. It seems that VB does not allow you to return a resultset. Is that correct or is there a workaround?

    prmPar3 should be the resultset output parameter.

    CODE:
    Dim Command As ADODB.Command
    Dim prmPar1 As ADODB.Parameter
    Dim prmPar2 As ADODB.Parameter
    Dim prmPar3 As ADODB.Parameter
    Dim sInput_1 as String
    Dim sInput_2 as String

    ' Open DB2 Connection to import data
    Set g_dbCon = New ADODB.Connection
    g_sConnectString = 'Some connection string
    g_dbCon.Open g_sConnectString

    'Set Command
    Set Command = New ADODB.Command
    Set Command.ActiveConnection = g_dbCon
    Command.CommandText = "ULPSPP.ULP_RM_REPORTS"
    Command.CommandType = adCmdStoredProc
    'Set Parameters
    Set prmPar1 = Command.CreateParameter("CONDCD", adChar, adParamInput, 2, sInput_1)
    Set prmPar2 = Command.CreateParameter("MANCO", adChar, adParamInput, 6, sInput_2)
    Set prmPar3 = Command.CreateParameter("RETCD", adSmallInt, adParamOutput)
    Command.Parameters.Append prmPar1
    Command.Parameters.Append prmPar2
    Command.Parameters.Append prmPar3

    'Exucute the Command
    g_dbCon.BeginTrans
    Command.Execute


    Any Ideas?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    ON, CAN
    Posts
    265
    dejavou, hehe

    you might want to delete this thread

    Regan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width