RSS Forums RSS
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1293 | Replies: 6 | Thread Tools  Display Modes
Join Date: Oct 2007
Location: South coast UK
Posts: 23
Reputation: FallenPaladin is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
FallenPaladin FallenPaladin is offline Offline
Newbie Poster

Question Will this work

  #1  
Nov 20th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the ASP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:52 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC