Click to See Complete Forum and Search --> : Stored Procedures


CecileR
May 21st, 2001, 11:37 PM
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

Tower
May 22nd, 2001, 01:04 AM
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

Cakkie
May 22nd, 2001, 01:11 AM
the procedure:

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




the vb code

set RS2VCP = cn.Execute("sp_MyProcedure")




Tom Cannaerts
slisse@planetinternet.be

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

CecileR
May 22nd, 2001, 03:12 AM
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