Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Atlanta, GA

    Unanswered: ADO and Output Parameters from SQL

    Hi guys,
    I have a huge problem with an app that I inherited. It is a VB6 app that used RDO.
    I am trying to convert it to use ADO, but the problem I am running into is DBA's wrote allot of stored procedures with OUTPUT parameter's, so instead of the procedure having a SELECT to pass back the value, it is passed back via the OUTPUT parameter.
    With RDO this is done easily with just passing back the parameter to a variable.
    I am not sure how to do this with ADO. Please shine some light for me.

    Here is an example:
    RDO code:
    Private rqAddRecord As RDO.rdoQuery
    Private rs As RDO.rdoResultset
    Set rqAddRecord = SQLServerDB.CreateQuery("", MakeSP("sp_UpdCourier", 11))

    With rqAddRecord
    .rdoParameters(0) = "I"
    .rdoParameters(1) = m.nCourierDeliveryID
    .rdoParameters(2) = m.dDeliveryDate
    .rdoParameters(3) = m.nCourierServiceID
    .rdoParameters(4) = m.nCourierID
    .rdoParameters(5) = m.sCourierDepartment
    .rdoParameters(6) = m.dTimeStart
    .rdoParameters(7) = m.dTimeComplete
    .rdoParameters(8) = g.sDatabaseUserName
    .rdoParameters(9) = m.dInvoiceDate
    .rdoParameters(10) = m.sInvoiceNumber


    m.nCourierDeliveryID = .rdoParameters(1)
    End With

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    You'll use ado command objects to pass parameters to/from stored procedures.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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