Please support our ASP advertiser: Lunarpages ASP Web Hosting
•
•
Join Date: Oct 2007
Location: South coast UK
Posts: 23
Reputation:
Rep Power: 2
Solved Threads: 0
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 = NothingSimilar Threads
Other Threads in the ASP Forum
- Why won't this code work? (VB.NET)
- My nic card won't work! (*nix Hardware Configuration)
- Motorola T720 Phone and Verizon Wireless (Gadgets and Gizmos)
- Can't get samba to work! (*nix Software)
- Mega Nerd (Geeks' Lounge)
Other Threads in the ASP Forum
- Previous Thread: Extract cell value from Excel and import data via email
- Next Thread: File Upload in MySQL Database with ASP
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Threaded Mode