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

Pagecount does not work with Command object

Status
Not open for further replies.

dirkg

Technical User
May 20, 2000
170
BE
Hi,

I open a recordset using the command object. I can assign a pagesize to it but not retrieve the pagesize (always returns 0). I use the command object to open my stored procedure because in that way I can name my parameters. However I can not assign how the recordset needs to be opened and therefore I use objCmd.Properties("Bookmarkable") = True to allow bookmarks.

So I have two possible solutions:

1. is it possible to open a recordset using the connection object and naming the parameters (so not just entering them in the right order)

Or

2. is it possible to open the recordset using the commandobject and specifiing that paging should be possible?


Here's how I open my recordset currently:


Set objCmd = Server.CreateObject( "ADODB.Command" )
Set objCmd.ActiveConnection = objConn
objCmd.CommandTimeout = 300

With objCmd

.commandText = "stp_Forum_Thread_List"
.CommandType = adCmdStoredProc
.parameters("@CategoryID") = lngCategoryID
.parameters("@ClientID") = Session("sesClientID")

End With
Set rst = Server.CreateObject( "ADODB.Recordset" )

objCmd.Properties("Bookmarkable") = True
set rst = objCmd.Execute()


I'm quite new in using ASP so any help is really appreciated.

Greetz,

Dirk
 
Meanwhile I found the solution:

I have to open the recordset using the following command:

rst.open objCmd,, adOpenStatic , adLockOptimistic ,adCmdStoredProc

See also thread thread333-410054 where I was pointed to the article that helped me.

Greetz,


Dirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top