I'm trying to incorperate a script into my website and use the forum's database. I've copied the required database fields and it works with the connection type I setup below.
I would like to use common.asp though to setup the connection. I've looked at some of the modules available for webwiz, and tried to duplicate it without suc6..
Can anybody help me? Thanks in advance.
below is part of the code without common.asp
<%
SET Conn = Server.CreateObject("ADODB.Connection")
SET RS = Server.CreateObject("ADODB.RecordSet")
sConnDatabase = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath("/xxx.mdb")
SUB OpenDB(sConn)
Conn.Open sConn
SET RS.ActiveConnection = Conn
RS.CursorType = AdOpenStatic
END SUB
SUB CloseDB(sConn)
RS.Close
Conn.Close
END SUB
OpenDB sConnDatabase
IF Request("Upload") = "True" THEN
Response.Write ("<P ALIGN='Center'><B>You have successfully uploaded a file, we will list your file as soon as it is approved.</B></P>")
END IF
UnapprCount =0
SQL = "SELECT * FROM LibrariesFiles WHERE Approved=False ORDER BY FileName"
SET RS = Conn.Execute(SQL)
DO WHILE NOT RS.EOF
UnapprCount = UnapprCount + 1
RS.MoveNext
here what I tried with common.asp
<!--#INCLUDE virtual="/xx/common.asp"-->
<%
IF Request("Upload") = "True" THEN
Response.Write ("<P ALIGN='Center'><B>You have successfully uploaded a file, we will list your file as soon as it is approved.</B></P>")
END IF
UnapprCount =0
strSQL = "SELECT * FROM LibrariesFiles WHERE Approved=False ORDER BY FileName"
rsCommon.Open strSQL, adoCon
DO WHILE NOT RScommon.EOF
UnapprCount = UnapprCount + 1
RScommon.MoveNext