%@ Language="VBSCRIPT" %> <% Dim DB_Path psw =0 Set Conn = Server.CreateObject("ADODB.Connection") DB_Path = Request.ServerVariables("APPL_PHYSICAL_PATH") & "fpdb/famchat.mdb" conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB_Path & ";" ' i named my DSN with chatdb, you can use any, but don't forget to change it here too Set rs = Server.CreateObject("ADODB.Recordset") ' create the record set SQLStmt = "SELECT * FROM chatmain" ' select everything from the chatmain table rs.Open SQLstmt,Conn,1,2 rs.close Set FileStreamObject = CreateObject("Scripting.FileSystemObject") ' this is how you create the scripting object Set writeStream = FileStreamObject.CreateTextFile(Server.MapPath("top.htm"), True) ' here you set the name of the file that will be created Set rs2 = Server.CreateObject("ADODB.Recordset") ' i've opened a new recordset because I had some problems with the other rs SQLStmt = "SELECT * FROM chatmain ORDER BY id DESC" rs2.Open SQLstmt,Conn,1,2 writeStream.WriteLine "" ' this is the command that writes to the file writeStream.WriteLine "
" ' as you see i am creating an html file writeStream.WriteLine "" ' this is the refresh that will ensure that the file is updated to the user of the chat writeStream.WriteLine "
| "
writeStream.WriteLine "
Loading Chat .....