CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2001
    Posts
    87

    Stored Procedures

    I am trying to convert my code using Recordset
    ...

    Set RS2VCP = New ADODB.Recordset
    RS2VCP.Open "Select VCPName, VCPStat, VCPErrs From TempVCP", cn, adOpenDynamic, adLockOptimistic
    ...

    to stored procedures where i get the returns of the records. how will i do these using stored procedures. do u have sample code?

    thanks for any help..

    cecile



    The more u read, the more u do not know

  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: Stored Procedures

    Read information from MSDN
    *************
    Executes the query, SQL statement, or stored procedure specified in the CommandText property.

    Syntax

    For a row-returning Command:

    Set recordset = command.Execute( RecordsAffected, Parameters, Options )

    Return Value
    Returns a Recordset object reference.

    Parameters

    RecordsAffected Optional. A Long variable to which the provider returns the number of records that the operation affected. The RecordsAffected parameter applies only for action queries or stored procedures. RecordsAffected does not return the number of records returned by a result-returning query or stored procedure. To return this information, use the RecordCount property.

    Parameters Optional. A Variant array of parameter values passed with an SQL statement. (Output parameters will not return correct values when passed in this argument.)
    **************

    This is information help you

    Andy Tower

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Stored Procedures

    the procedure:

    CREATE PROC sp_MyProcedure
    as
    SELECT VCPName, VCPStat, VCPErrs,
    FROM TempVCP




    the vb code

    set RS2VCP = cn.Execute("sp_MyProcedure")




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  4. #4
    Join Date
    Apr 2001
    Posts
    87

    Re: Stored Procedures

    I get it.. but then it does not return any recordset..

    if i write

    Set RS2VCP = new ADODB.Recordset
    Set RS2VCP = cn.Execute("OpenTempVCP")

    I cannot write

    RS2VCP.EOF


    pls help guys..thanks

    cecile

    The more u read, the more u do not know

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

Featured