PDA

View Full Version : about objRecordset.Bookmark


Piek444
05-11-2003, 07:19 AM
can someone help about this error msg?

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.


i just try this simple bookmark, but it cant work, why?

<%


gstrConn="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MBizLine;Data Source=totustuus;uid=sa"

set adoConn = server.CreateObject("ADODB.Connection")
if adoConn is nothing then
Err.Raise RTN_ERROR, "OpenConn", "Unable to create connection object!"
else
adoConn.Open gstrConn
end if


set rs = Server.CreateObject("ADODB.recordset")
sql="SELECT User_name FROM tbuser"
rs.Open sql, gstrconn

rs.movefirst

bkmark = rs.bookmark
rs.movelast
rs.bookmark = bkmark


%>


tq for ur help :>

Roy Sinclair
05-12-2003, 03:42 PM
Try this:


set rs = Server.CreateObject("ADODB.recordset")
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
sql="SELECT User_name FROM tbuser"


Note, if you don't have the ADO constants loaded replace adUseStatic with 3 and adUseClient with 3.

Piek444
05-12-2003, 06:03 PM
tq for the coding.. its work..

there is another question, if i want displayind some data , using the moveprev or movenext method, what should i do?


like this sample :

(figure it as a form)

<< < > >>
Name : handy
Country : USA


(i want)
<< = movefirst
<< = movelast
< = moveprevious
> = movenext
if i click the < , it's should go to the previous record
and if i click the >, it's should go to the next record..

what so i do?
use a href? or what? coz i thought if i used the bookmark, should be more easier than using the a href =xxxx.asp?variables

tq so much Roy Sinclair

Roy Sinclair
05-12-2003, 06:23 PM
You are thinking in terms of the user interacting with the ASP script as it runs on the server, that's not possible though because the ASP script has completed executing by the time the user can click on anything. You have to pass user actions to a script using forms or the URL and then run the script again or a different script to handle the user action and send a new page.

Another alternative is to send the whole output to the client and use Javascript on the client to page through the list but that's really only good if you have a very fast link to the client or you can be sure the number of records returned is always rather small.

Don't count on the bookmark to work across multiple recordset requests, you should store the key values for the current row instead.

If you are paging through a lot of records then this (http://www.4guysfromrolla.com/webtech/121298-1.shtml) article may be of help.

Piek444
05-13-2003, 04:26 AM
thanks, i saw the article already, and normally i using javascript for this case, but the connection to slow.. so, i try the bookmark method..

may be better i use action script, tq for the explanation

God Bless U

Chien Lie