p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: SV: RE: Moving in recordset.


Message #1 by =?iso-8859-1?Q?Fredrik_Flyghed_=28F=F6rs=E4kringsdata=29?= on Fri, 15 Sep 2000 07:20:12 +0100
Thanks for the advise.
I solved it yesterday by instead of adOpenDynamic use asOpenKeyset.
I changed one word and it solved my problem.
Thanks to you all.

		/ Fredrik

-----Ursprungligt meddelande-----
Fr=E5n: Robert Chartier [mailto:Robert.Chartier@T...]
Skickat: den 14 september 2000 17:22
Till: Code Clinic
=C4mne: [proasp_codeclinic] RE: Moving in recordset.


#1. you create a connection object but dont use it to populate your
recordset
	rstStory.Open sqlStory, connstring, adOpenDynamic
		change to
	rstStory.Open sqlStory, conn, adOpenDynamic

#2. you can save the .movelast by changing your ORDER BY clause
	or even better get it to only return the last date

sqlStory=3D"SELECT Max(tblNeverending.Date) as Max_Date FROM 
tblNeverending "
Set rstStory=3Dserver.createobject("ADODB.Recordset")
rstStory.Open sqlStory, conn		'you wont need a dynamic recordset
here
OLD=3DrstStory("Max_Date")






-> -----Original Message-----
-> From: Fred [mailto:fredrik@f...]
-> Sent: Thursday, September 14, 2000 8:43 AM
-> To: Code Clinic
-> Subject: [proasp_codeclinic] Moving in recordset.
->
->
-> I have this code:
->
-> Set conn =3D server.createobject("ADODB.Connection")
-> conn.open connstring
-> =09
-> sqlStory=3D"SELECT * FROM tblNeverending ORDER BY 
tblNeverending.Date"
-> =09
-> Set rstStory=3Dserver.createobject("ADODB.Recordset")
-> rstStory.Open sqlStory, connstring, adOpenDynamic
-> =09
-> rstStory.MoveLast
-> OLD=3DrstStory("Date")
->
-> I get this error:
->
-> Microsoft OLE DB Provider for SQL Server error '80040e24'
->
-> The rowset does not support fetching backwards
->
-> /updatecheck.asp, line 19
->
->
-> What=B4s wrong ?
->



  Return to Index