Recordset into integer

  • Thread starter Thread starter Rajat
  • Start date Start date
R

Rajat

Hi,

I have a stored procedure that returns a one-record, one-
field recordset off a SELECT statement.

I need to be able to return this value from the stored
procedure as an integer.

In VBA, I would have done the following:

*************************************************
Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly,
dbReadOnly)
If rs.RecordCount = 0 Then
intLaptopCount = 0
Else
intLaptopCount = rs![LaptopCount]
End If
***************************************************

Thanks,

Rajat
 
Hello Rajat:
You wrote in conference microsoft.public.access.adp.sqlserver on Mon, 19
Jul 2004 13:47:24 -0700:

R> Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly,
R> dbReadOnly)
R> If rs.RecordCount = 0 Then
R> intLaptopCount = 0
R> Else
R> intLaptopCount = rs![LaptopCount]
R> End If
R> ***************************************************

select
case
when exists(select LaptopCount from mytable where
mysearcharg=myfavoritevalue)
then (select LaptopCount from mytable where
mysearcharg=myfavoritevalue)
else 0
end


Vadim
 
Back
Top