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

adOpenForwardOnly and input parameters

Status
Not open for further replies.

unseth

Programmer
Sep 10, 2000
31
US
normally i open my recordset like so:

set objRS = Server.CreateObject("ADODB.Recordset")
objRS.LockType = 1 'adLockReadOnly
objRS.CursorType = 0 'adOpenForwardOnly

but now i want to use this method so I can use input parameters in my SPO for recordcounts. Does this method default to adOpenForwardOnly and adLockReadOnly or do I have to do something else to it?

Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConn
objCommand.CommandType = adCmdStoredProc
objCommand.CommandText = "usp_pagingtest1"
objCommand.Parameters.Append objCommand.CreateParameter("@SrchCriteria", adVarChar, adParamInput, 50, strSrchCriteria)
objCommand.Parameters.Append objCommand.CreateParameter("@TotalRecs", adInteger, adParamOutput, 4)
Set objRS = objCommand.Execute


thanks
 
I think i just need to add these lines:

objCommand.CursorType = adOpenForwardOnly
objCommand.LockType = adLockReadOnly

seems that might work the same way on a command as a recordset..?
 
so how can i make it forwardonly and readonly and still use input parameters?
 
by default is readonly and forwardonly so you don't have to specify any aditional parameters
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top