Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 23rd, 2003, 09:44 AM
Authorized User
 
Join Date: Jul 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default command object scrolling

how do i specify the options for the command object so that it is scrollable for using find function of recordset later on ...

eg.
objComm.CommandText="SELECT MsgID FROM Message WHERE ReceiverID" _
                    "LIKE '" & Session("TenantID") & "' ORDER BY" _
                    "MsgDate DESC"
Set objSurround = objComm.Execute
objSurround.Find = "MsgID = " & Request.QueryString("MsgID")

this gives an error that the recordset isnt scrollable .. how do make it scrollable ...

 
Old July 24th, 2003, 08:44 AM
Authorized User
 
Join Date: Jul 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:(hey someone help me out ...

 
Old July 24th, 2003, 09:29 AM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hey!

To get you started, look into the cursor you are creating.
And also think about using the recordset object directly without
using the command object at all.

At first glance I am guessing that the problem is to do with the fact that the recordset returned cannot be traversed.
Such as in a Forward Only cursor...and I think...that the default for the command object is such a cursor....?

Try using the objSurround.Filter = "MsgID = " & Request("MsgID") instead to shrink the recordset temporarily.

If this doesn't work you will probably need to change the cursor you are using....along with the using the recordset object instead of the Command object so that you can specify the cursor type to use.....and also look into the way you are connecting to the datasource to make sure that the provider {driver} supports the features you're intending to use.

see how you get on....
 
Old July 24th, 2003, 09:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Set these properties on the recordset object before you do the Execute:
.CursorLocation = 3 ' adUseClient
.CursorType = 3 ' adOpenStatic

Just wondering, why don't you just add the MsgId you want to the WHERE clause of your SQL statement?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Command text was not set for the command object Sheraz Khan Classic ASP Databases 2 May 29th, 2007 12:57 AM
Command Object - commandType error europhreak Classic ASP Basics 7 February 2nd, 2006 04:55 AM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM
Help! 'Command object error' sisi Classic ASP Databases 4 May 25th, 2004 06:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.