Test this code:
<%
Option Explicit
Response.Buffer = TRUE
Dim strSQLmembers, strSQLcount, strMemberName
Dim objDB, objRSmembers
Dim intTotalMembers, N, intMemberPosts, intArrLength
Dim valList, lblList
N = 0
%>
<HTML>
<HEAD>
<TITLE>BarChart</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY bgcolor="#FFFFFF" text="#000000">
<%
strSQLcount = "SELECT Count(MEMBER_ID) FROM FORUM_MEMBERS"
strSQLmembers = "SELECT M_USERNAME, M_POSTS FROM FORUM_MEMBERS ORDER BY M_USERNAME ASC"
Set objDB = GetDBConn
Set objRSmembers = objDB.Execute(strSQLcount)
intTotalMembers = objRSmembers(0)
Set objRSmembers = objDB.Execute(strSQLmembers)
If Not objRSmembers.EOF Then
'## -- now we can set the arrays at correct length --
intArrLength = intTotalMembers - 1
'## -- create both arrays in correct length --
ReDim valList(intArrLength)
ReDim lblList(intArrLength)
'## -- loop through the recordset and save member values into both of the arrays --
Do Until objRSmembers.EOF
strMemberName = objRSmembers(0)
intMemberPosts = objRSmembers(1)
'## -- store username and total posts into separate arrays --
valList(N) = intMemberPosts
lblList(N) = strMemberName
objRSmembers.MoveNext
Loop
End If
Set objRSmembers = Nothing
Set objDB = Nothing
'## -- build the barchart --
chartOpt = "Caption:Sales by State;MaxScale:200;GridColor:FF0000;LabelColor:0000FF"
BarChart valList, lblList, chartOpt
%>
</BODY>
</HTML>
<%
'## -- FUNCTION AND SUBS START HERE --
'## -- creates a adodb.connection object and return it --
Function GetDBConn
Dim m_objConn
Set m_objConn = Server.CreateObject("ADODB.Connection")
m_objConn.Open "Provider=SQLOLEDB.1;Server Name=localhost;Database=snitzforum;User ID=sa;Pwd=;"
'## -- return a opened connection object --
Set GetDBConn = m_objConn
End Function
%>
Change the connectionstring to suite your database choice.
cya,
PatrikB