I have a stored proc on an existing 3rd party application (SQL 2005) that I wish to interact with.
It is an insert statement followed by a select statement as follows;
Set @CustomerId = Cast(SCOPE_IDENTITY() As [int])
Select @CustomerId
Using VB6 how do I access the value of @CustomerID?
set rs = cmd.Execute
is not returning a resultset as expected…
[Edit]
rs.Fields.Count is 0.
Any attempt to access the resulting recordset, like rs(0).Value simply causes an “Item not found…” error.
I would guess that your stored procedure is returning more than one recordset.
If this is the case, you can use the
NextRecordset()method to iterate through them.MSDN:
This means I would suggest something like this to solve your problem: