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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change the way recordset is opening ? (from .execute to .open)

Status
Not open for further replies.

digarton

Programmer
Jun 16, 2000
3
CA
The problem is :<br>The guy opened recordset using command object by EXECUTE method. That recordset doesn't support PageCount and PageSize properties. I need to change the way to open recordset. Should I use .Open method instead of .Execute and if I should so how to do that? Or I can open recordset properly with PageCount supported using the same .Execute method for command ?<br>Thanks ;-)
 
Use the Open method.<br><br>dim rs<br>set rs = server.createobject(&quot;ADODB.recordset&quot;)<br><br>sql = &quot;SELECT * FROM table&quot; 'your SQL statement goes here<br><br>rs.open sql, activeconnection, 3, 3<br>----<br>The first 3 is the the Keyset Cursor value<br>The second 3 is the Pessimistic lock value<br><br>You need this combination of the cursor and lock type to get the pagecount working. The reason why you're getting an error right now is not only due to the EXECUTE method but also the type of cursor and lock type you're using.
 
To LuvASP.<br><br>I already try to do that, but I can't transfer parameter for stored procedure, just the name in sql-string. So server gave me error message.<br><br>Any way thanks.
 
you can pass parameters to a stored procedure.<br><br>sSQL = &quot;NameStoreProcedure '&quot; & sParameter1 & &quot;'&quot;<br><br>or if it is a number just pass it without the single quotes.<br><br>try printing out the sSQL before you open and try running it in your Database and see if you get an error, debug from there.<br><br>Toddb<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top