How to retrieve the contents of an output variable

Results 1 to 2 of 2

Thread: How to retrieve the contents of an output variable

  1. #1
    Isabelle Guest

    Default How to retrieve the contents of an output variable

    My stored procedure (sql server) inserts stuff and then returns the identity of the updated row into an output variable.<BR>Is it possible to retrieve the contents of this variable from an ASP page without using recordsets?<BR>This procedure contains a couple of select statements before inserting data. If I use recordsets, I&#039;ll have to use NextRecordset to access the one variable I need.<BR>I hope you can help me.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How to retrieve the contents of an output vari

    From ADO help...<BR><BR>A Command object has a Parameters collection made up of Parameter objects.<BR><BR>Using the Refresh method on a Command object&#039;s Parameters collection retrieves provider parameter information for the stored procedure or parameterized query specified in the Command object. Some providers do not support stored procedure calls or parameterized queries; calling the Refresh method on the Parameters collection when using such a provider will return an error.<BR><BR>If you have not defined your own Parameter objects and you access the Parameters collection before calling the Refresh method, ADO will automatically call the method and populate the collection for you.<BR><BR>You can minimize calls to the provider to improve performance if you know the properties of the parameters associated with the stored procedure or parameterized query you wish to call. Use the CreateParameter method to create Parameter objects with the appropriate property settings and use the Append method to add them to the Parameters collection. This lets you set and return parameter values without having to call the provider for the parameter information. If you are writing to a provider that does not supply parameter information, you must manually populate the Parameters collection using this method to be able to use parameters at all. Use the Delete method to remove Parameter objects from the Parameters collection if necessary.<BR><BR> Dim p As Parameter<BR> p.Direction = adParamOutput &#039;default is input<BR><BR>

Posting Permissions

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