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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Whats wrong with this code? ../Total members!
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

kjartis
New Member

Norway
94 Posts

Posted - 06 May 2002 :  20:19:20  Show Profile  Visit kjartis's Homepage
I want a code that shows me the total nummber of users outside the forums.
I have tryed to paste different codes together and this is what I have:

<%
Set Conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\fakefolder\database.mdb"
CONN.OPEN ConnString

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

set rs = my_Conn.execute(strSql)

TotalUsers = rs("U_COUNT")
Response.write("Currently " & " " & TotalUsers & " " & " members.")

rs.Close
set rs = nothing

CONN.Close
set CONN = nothing
%>


But I can't get it to work!
Does anyone know whats wrong with the code?

Edited by - Kjartis on 06 May 2002 20:37:08

Steve D.
Average Member

USA
640 Posts

Posted - 06 May 2002 :  20:26:22  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
This is what I use on my site

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

Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open strSql, my_Conn

Total_Member_Count = rs1("U_COUNT")

rs1.Close
set rs1 = nothing


you can see it at http://www.itsallswing.com/forum

----------------------------------------
Badges? We don't need no stinking badges
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 06 May 2002 :  20:28:10  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
whoops didn't read your post completely, you may want to try and include config.asp in your other page.

----------------------------------------
Badges? We don't need no stinking badges
Go to Top of Page

kjartis
New Member

Norway
94 Posts

Posted - 06 May 2002 :  20:35:45  Show Profile  Visit kjartis's Homepage
The code you are refering to is one of the codes I have tryed to manipulate.
U see I want to show the code on my default.asp page, one folder down from the forums ../
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 06 May 2002 :  20:52:18  Show Profile  Visit James's Homepage
Are you referring to active users on your website (not just your forum) and showing these users in active Users? Or are you referring to the total number of members, not just the total that have posted?


-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

kjartis
New Member

Norway
94 Posts

Posted - 06 May 2002 :  21:31:06  Show Profile  Visit kjartis's Homepage
quote:
Are you referring to active users on your website (not just your forum) and showing these users in active Users? Or are you referring to the total number of members, not just the total that have posted?
I want the total number of members in my forums to show outside of the forums!
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 06 May 2002 :  22:42:24  Show Profile  Visit James's Homepage
Try the following test page:


<html>

<head>
<title>Test Page</title>

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

</head>

<body>

<%

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")
Response.write("There are Currently " & " " & TotalUsers & " " & " members.")
%>

</body>
</html>


Note that the INCLUDE FILE statement is set in this page to be in one directory off the root, but other than the forum directly (which is also off the root). You may have to change this statement to accomadate where your page is located on your site. For instance, if your page resides in your root directory and your forum directory is one directory off the root directory, then the statement would change to:


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


Also note, that it must be inside a asp file, not a html file. Create a file titled "test.asp" and post the code above in it.

-
*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*



Edited by - James on 06 May 2002 23:01:02
Go to Top of Page

kjartis
New Member

Norway
94 Posts

Posted - 06 May 2002 :  23:17:13  Show Profile  Visit kjartis's Homepage
Thanks!

It works great!
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.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07