Hi I am experimenting with VBScript and SQL and am unsure if the following code will actually work. I do not have access to IIS at present so I am unable to test it. I would be greatfull if anyone could just take a brief look at the code to see if the syntax is correct. Thanks
<%@Language = "VBScript" %>
<%Option Explicit%>
<!--#include virtual="/advobs.inc"-->
<%
Dim newDate
Dim newTime
Dim newMessage
Dim objConn
Dim sqlInsert
Dim objRecordSet
Set objConn = Server.CreatObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};"&_"DBQ=C:/inetpub/wwwroot/feedBack.mdb"
objConn.Open
newDate = Date()
newTime = Time()
newMessage = request.form("strMessage")
if newMessage <> "" then
sqlInsert="INSERT INTO tblMessages(date,time,message) VALUES(newDate,newTime,newMessage)"
end if
Set objRecordSet=Server.CreateObject("ADODB.Recordset")
objRecordSet.Open "tblMessages", objConn,,,adCmdTable
Do while Not objRecordSet.EOF
Response.Write"<B>" & objRs ("time") & "</B><BR>"
Response.Write objRs("date") & "<BR>"
Response.Write objRs ("message") & "<BR>"
Response.Write "<p><hr></p>"
objRecordSet.MoveNext
Loop
objRecordSet.Close
Set objRecordSet = Nothing
objConn.Close
Set objConn = Nothing