Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordCount property in SQL Server

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
US
I am receiving a -1 for my recordCount property in a query that is opened like:

Set objConns = Server.CreateObject ("ADODB.Connection" )
set objResps = Server.CreateObject ("ADODB.recordset" )

objResps.LockType = adLockOptimistic
objResps.CursorType = adOpenKeyset

objResps.Open thisQuery, objConns

I can't do a moveLast or a movePrevious. Everything I have read says that the Cursor type and Lock type determines this. As to what I have read my query should work, but it doesn't. I have tried adOpenDynamic

Any ideas?

Thanks in advance,
Jerry

Jerry Scannell
 
Turns out that making it a Client Cursor worked. Why did I have to do this? This code has worked in the past with another SQL Server database without any problems. Now it fails unless I make it a client server.

Thanks,
Jerry

Jerry Scannell
 
This is the server-side ASP that I use and it does allow for movePrevious and moveLast, you can give it a try if you would like.
Code:
var adOpenStatic     = 3;
var adLockOptimistic = 3;
var adUseClient      = 3;
var adModeReadWrite  = 3;
objResps.ActiveConnection = oConn;
objResps.CursorType = adOpenStatic;
objResps.LockType = adLockOptimistic;
objResps.CursorLocation = adUseClient;



<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top