Hi there,
The error is caused by the fact that the Execute method has reset the CursorType for the Recordset back to adOpenForwardOnly. You can check that out with this code:
Response.Write("CursorType is " & objRS.CursorType)
You'll see it has a value of 0 again.
Ways to work around this:
1. Don't use the Command Object, but use the Open method of the Recordset. This allows you to preserver the CursorType value.
2. Don't use the Find method, but instead use Username in your WHERE clause. IMO, this makes more sense as you are not retrieving all records from the database, but just the one you need.
You may be able to change the Command object, so it doesn't return a forward-only, read-only recordset, but I am not sure about that. The documentation for the Connection's Execute method explicitly states it returns a firehose cursor, but for the Command object there is no mention of this.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|