Print Page | Close Window

rs.recordset -> sql

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8729
Printed Date: 01 April 2026 at 1:12am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: rs.recordset -> sql
Posted By: Badaboem
Subject: rs.recordset -> sql
Date Posted: 10 January 2004 at 4:36am

Trying to convert a mod to ms sql, where the access version uses rs.recordset. I've read on google that ms sql always returns -1 and that count(*) should be used instead.

I'm using this for a ''next page'' button, and it should return the records where approved is 1.

Does count(*) return only the amount of rows, and do I have to create new sql statements to get the actual data from the tables, or is it possible to combine the two methods of returning amount and data?


SET RS = Server.CreateObject("ADODB.RecordSet")
rs.CursorType = 1
rs.LockType = 3
strSQL = "SELECT LibrariesFiles.ProgramName, LibrariesFiles.ID, LibrariesFiles.UploadedBy, LibrariesCategories.Categoryname FROM LibrariesCategories, LibrariesFiles"
strSQL = strSQL & " WHERE librariesFiles.CatID = LibrariesCategories.ID AND Approved=1"
strSQL = strSQL & " ORDER BY LibrariesFiles.ID DESC;"

Thanks in advance.




Replies:
Posted By: Badaboem
Date Posted: 11 January 2004 at 4:16pm

Never mind..got it.

strSQL = "SELECT LibrariesFiles.ProgramName, LibrariesFiles.ID, LibrariesFiles.UploadedBy, LibrariesCategories.Categoryname, (SELECT COUNT (ID) From Librariesfiles WHERE approved=1) AS DOWNLOAD_COUNT FROM LibrariesCategories, LibrariesFiles"




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net