p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Moving in recordset.


Message #1 by "Fred" <fredrik@f...> on Thu, 14 Sep 2000 16:42:51 +0100
#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