|
-
Apr 14th, 2001, 09:30 PM
#1
Thread Starter
New Member
can somebody tell me what is wrong with this code.. i am trying to get the count..
Dim rsMessages2
Set rsMessages2 = DB.Execute ("SELECT count(*) FROM Messages WHERE ForumID = " & ForumID)
Response.Write rsMessages2
the error is on the "Response.Write rsMessages2"
thanks
ren
-
Apr 15th, 2001, 09:14 AM
#2
New Member
Try this:
<%
Dim rstCount
Set rstCount = cnnDb.Execute("SELECT COUNT(*) FROM Messages WHERE ForumId=" & lngForumId & ";")
Response.Write rstCount(0)
%>
.. should work.
-
Apr 16th, 2001, 10:37 AM
#3
Frenzied Member
Or you could change this:
Response.Write rsMessages2
to say this:
Response.Write rsMessages2 & "_<BR>"
That might help, .....
~Peter

-
Apr 16th, 2001, 10:38 AM
#4
Black Cat
See if this will work as well. Your problem is that you are trying to write the Recordset Object, not a string.
Code:
Dim rsMessages2
Set rsMessages2 = DB.Execute ("SELECT count(*) AS MyCount FROM Messages WHERE ForumID = " & ForumID)
Response.Write rsMessages2.Fields("MyCount")
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|