Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Max number of records


Message #1 by Webmaster <webmaster@o...> on Thu, 18 Jan 2001 17:13:56 -0800

Am having trouble with the ADO property "MaxRecords"



Dim conntempt

set conntempt=server.createobject("adodb.connection")

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

conntempt.Open DSNtemp

Dim rst, SQLT

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

rst.MaxRecords = 5

SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"



rst.Open SQLT, conntempt





The above is still pulling all records. Any help would be appreciated.



Thanks John



Message #2 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Thu, 18 Jan 2001 11:27:40 +0100
Hi!



Just a thought...have you tried "Select TOP 5 M_NAME etc...?



Hakan



-----Original Message-----

From: Webmaster [mailto:webmaster@o...]

Sent: den 19 januari 2001 02:14

To: ASP Databases

Subject: [asp_databases] Max number of records





Am having trouble with the ADO property "MaxRecords"



Dim conntempt

set conntempt=server.createobject("adodb.connection")

DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

conntempt.Open DSNtemp

Dim rst, SQLT

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

rst.MaxRecords = 5

SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"



rst.Open SQLT, conntempt





The above is still pulling all records. Any help would be appreciated.



Thanks John



Message #3 by Webmaster <webmaster@o...> on Thu, 18 Jan 2001 18:57:58 -0800
Thanks, will try out and advise.



At 11:27 AM 1/18/01 +0100, you wrote:

>Hi!

>

>Just a thought...have you tried "Select TOP 5 M_NAME etc...?

>

>Hakan

>

>-----Original Message-----

>From: Webmaster [mailto:webmaster@o...]

>Sent: den 19 januari 2001 02:14

>To: ASP Databases

>Subject: [asp_databases] Max number of records

>

>

>Am having trouble with the ADO property "MaxRecords"

>

>Dim conntempt

>set conntempt=server.createobject("adodb.connection")

>DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

>DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

>conntempt.Open DSNtemp

>Dim rst, SQLT

>Set rst= Server.CreateObject("ADODB.Recordset")

>rst.MaxRecords = 5

>SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"

>

>rst.Open SQLT, conntempt

>

>

>The above is still pulling all records. Any help would be appreciated.

>

>Thanks John

>

Message #4 by "Wally Burfine" <oopconsultant@h...> on Thu, 18 Jan 2001 14:01:32 -0000
Try:



SQLT = "SELECT TOP 5 M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS





>From: Webmaster <webmaster@o...>

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] Max number of records

>Date: Thu, 18 Jan 2001 17:13:56 -0800

>

>

>Am having trouble with the ADO property "MaxRecords"

>

>Dim conntempt

>set conntempt=server.createobject("adodb.connection")

>DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

>DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

>conntempt.Open DSNtemp

>Dim rst, SQLT

>Set rst= Server.CreateObject("ADODB.Recordset")

>rst.MaxRecords = 5

>SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"

>

>rst.Open SQLT, conntempt

>

>

>The above is still pulling all records. Any help would be appreciated.

>

>Thanks John

>

Message #5 by Webmaster <webmaster@o...> on Thu, 18 Jan 2001 19:28:52 -0800
Thank you!! Worked just fine......the answer is so simple (if you know:=))



At 11:27 AM 1/18/01 +0100, you wrote:

>Hi!

>

>Just a thought...have you tried "Select TOP 5 M_NAME etc...?

>

>Hakan

>

>-----Original Message-----

>From: Webmaster [mailto:webmaster@o...]

>Sent: den 19 januari 2001 02:14

>To: ASP Databases

>Subject: [asp_databases] Max number of records

>

>

>Am having trouble with the ADO property "MaxRecords"

>

>Dim conntempt

>set conntempt=server.createobject("adodb.connection")

>DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

>DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

>conntempt.Open DSNtemp

>Dim rst, SQLT

>Set rst= Server.CreateObject("ADODB.Recordset")

>rst.MaxRecords = 5

>SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"

>

>rst.Open SQLT, conntempt

>

>

>The above is still pulling all records. Any help would be appreciated.

>

>Thanks John

>

Message #6 by Webmaster <webmaster@o...> on Fri, 19 Jan 2001 01:56:23 -0800
Thank you, this worked fine:)



John

Message #7 by "Ken Schaefer" <ken@a...> on Fri, 19 Jan 2001 11:45:58 +1100
Already covered here:



http://www.adopenstatic.com/faq/maxrecordsnotworking.asp



Cheers

Ken



----- Original Message ----- 

From: "Webmaster" <webmaster@o...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, January 19, 2001 12:13 PM

Subject: [asp_databases] Max number of records





> 

> Am having trouble with the ADO property "MaxRecords"

> 

> Dim conntempt

> set conntempt=server.createobject("adodb.connection")

> DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "

> DSNtemp=dsntemp & "DBQ=" & server.mappath("./cgi-bin/xxxx/xxxxxx.mdb")

> conntempt.Open DSNtemp

> Dim rst, SQLT

> Set rst= Server.CreateObject("ADODB.Recordset")

> rst.MaxRecords = 5

> SQLT = "SELECT M_NAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_POSTS DESC"

> 

> rst.Open SQLT, conntempt

> 

> 

> The above is still pulling all records. Any help would be appreciated.

> 

> Thanks John






  Return to Index