aout cursor staoed procedure and vb6 (ado)
- From: "Tom" <pclan@xxxxxxxxxxxx>
- Date: Tue, 14 Jun 2005 09:42:45 +0800
Hi : I create the simple cursor stored procedure as follow :
CREATE PROCEDURE SP_CURSORSAMPLE
@retValue nvarchar(15) output
AS
DECLARE @iAcID INT,
@nSumAmount Money,
@sType nVarchar(50),
@iDetailID INT
DECLARE curBsDetail CURSOR FOR
SELECT sTenantCode
FROM tenantprofile
OPEN curBsDetail
FETCH NEXT FROM curBsDetail INTO
@retValue
WHILE @@FETCH_STATUS = 0
BEGIN
print @retValue
FETCH NEXT FROM curBsDetail INTO
@retValue
END
CLOSE curBsDetail
DEALLOCATE curBsDetail
if I use ado.command to execute how can I get return value of retValue
during the command is execute : I try to write the similar vb code but it
not work
Dim Cmd As Command
de.cnn.Open
Set Cmd = New Command
With Cmd
.CommandText = "SP_CURSORSAMPLE"
.CommandType = adCmdStoredProc
.ActiveConnection = de.cnn
.Parameters.Append .CreateParameter("retValue", adVarWChar,
adParamOutput, 15)
.Execute , , adAsyncFetch '<--- start ASYNCHROUS
Do While (.State And adStateExecuting) = adStateExecuting
Debug.Print .Parameters("retValue")
Loop
End With
can anyoneresolve my problem ?
Thanks
.
- Follow-Ups:
- Re: aout cursor staoed procedure and vb6 (ado)
- From: William \(Bill\) Vaughn
- Re: aout cursor staoed procedure and vb6 (ado)
- Prev by Date: Re: jro.CompactDatabase stopped working
- Next by Date: Re: aout cursor staoed procedure and vb6 (ado)
- Previous by thread: jro.CompactDatabase stopped working
- Next by thread: Re: aout cursor staoed procedure and vb6 (ado)
- Index(es):
Loading