Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Need help with Simple ASP code
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 01 March 2001 :  17:36:09  Show Profile
I want to show the total number of members on another page than the forum - this is what I have so far:

<%
<!--#INCLUDE FILE="config.asp" -->

set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnStringset rs = Server.CreateObject("ADODB.Recordset")
strSql ="SELECT " & strTablePrefix & "TOTALS.U_COUNT "
strSql = strSql & " FROM " & strTablePrefix & "TOTALS "
set rs = my_Conn.execute(strSql)TotalUsers = rs.("U_COUNT")my_Conn.Close
set my_conn = nothing

Response.write("join our forum, which has currently " & TotalUsers & " members.")
%>

I get the following error:

Microsoft VBScript compilation error '800a0400'

Expected statement

/hifi/users.asp, line 2

<!--#INCLUDE FILE="config.asp" -->
^

can anyone help ?

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 01 March 2001 :  17:51:59  Show Profile
Your Line #2:


my_Conn.Open strConnStringset rs = Server.CreateObject("ADODB.Recordset")


looks like it's 2 lines on one.

change it to this:


my_Conn.Open strConnString
set rs = Server.CreateObject("ADODB.Recordset")


see below post

Edited by - Richard Kinser on 01 March 2001 17:58:22
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 01 March 2001 :  17:56:43  Show Profile
There is another line in there that looks like it should be 2 lines also. The Include file can't be withing the ASP tags.

Try using this:


<!--#INCLUDE FILE="config.asp" -->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

strSql ="SELECT " & strTablePrefix & "TOTALS.U_COUNT "
strSql = strSql & " FROM " & strTablePrefix & "TOTALS "

set rs = my_Conn.execute(strSql)

TotalUsers = rs("U_COUNT")

my_Conn.Close
set my_conn = nothing

Response.write("join our forum, which has currently " & TotalUsers & " members.")
%>
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 02 March 2001 :  03:46:36  Show Profile
thanks Richard, it works.

how do I add some formatting to this ? for example verdana pixel size 8 ?



Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 02 March 2001 :  06:42:08  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I usually never try to match a pixel size on font but i believe this is it......


Response.write("<font face=""Verdana, Arial, Helvetica"" size=""8px"">join our forum, which has currently " & TotalUsers & " members.</font>")


Brad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07