NoCoolHandle
Programmer
Does anyone know how to return both an output parameter to a VB6 app using Ado?
I have been trying to do this from a single storedproc, but it seems that I can either get the recordset or the parameter. Not both.
Code looks something like...
[blue]
Dim cnlane As ADODB.Connection
Dim rs As Recordset
Dim cmd As ADODB.Command
Set cnlane = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
cnlane.Open "provider=sqloledb;server=(local);integrated security=sspi;database=lanemessages"
With cmd
.CommandText = "dbo.procGetMessages"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@plazahassome", adInteger, adParamOutput)
.ActiveConnection = cnlane
Set rs = .Execute
MsgBox .Parameters("@plazahassome").Value
End With
cnlane.Close
[/blue]
If I omit [blue]Set rs = .Execute[/blue] then the parameter is returned, if not, no parameter....
I have also tried
[blue]rs.ActiveCommand.parameters("@plazahassome").value[/blue] but this also fails..
Any help is appreciated.
Rob
I have been trying to do this from a single storedproc, but it seems that I can either get the recordset or the parameter. Not both.
Code looks something like...
[blue]
Dim cnlane As ADODB.Connection
Dim rs As Recordset
Dim cmd As ADODB.Command
Set cnlane = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
cnlane.Open "provider=sqloledb;server=(local);integrated security=sspi;database=lanemessages"
With cmd
.CommandText = "dbo.procGetMessages"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@plazahassome", adInteger, adParamOutput)
.ActiveConnection = cnlane
Set rs = .Execute
MsgBox .Parameters("@plazahassome").Value
End With
cnlane.Close
[/blue]
If I omit [blue]Set rs = .Execute[/blue] then the parameter is returned, if not, no parameter....
I have also tried
[blue]rs.ActiveCommand.parameters("@plazahassome").value[/blue] but this also fails..
Any help is appreciated.
Rob