I have successfully added data into Access databases previously using SQL 'insert into ...' using VbScript on ASP pages.
I have an application that does logging of user activity on my website, and I am trying to use Access for this purpose.
For some reason I can not figure out, I am hitting syntax errors this time, and all my effort to fix it.
My code is:
' Write the form results to the file.
' declare your variables
Dim dbPath, objConn, objRS, sSQL, aRS, SFile, SUser
dbPath = "C:\SpiderLog\spiderlog.md
Set objConn = CreateObject("ADODB.Connec
Set objRS = CreateObject("ADODB.Record
TA SOURCE=" & dbPath
' declare SQL statement that will insert into the database
'sSQL="select User, File from SpiderLog"
'objRS.Open sSQL, objConn
'aRS = objRS.GetRows()
'response.write aRS(0,0) & "<br>"
'response.write aRS(1,0) & "<br>"
'response.write "<br>read from SpiderLog completed<br><br>"
sSQL = "INSERT into SpiderLog "
sSQL = sSQL & "(User,File) "
sSQL = sSQL & " Values "
sSQL = sSQL & "("
sSQL = sSQL & "'" & SUser & "', "
sSQL = sSQL & "'" & SFile & "'"
' sSQL = sSQL & "'" & date() & "', "
' sSQL = sSQL & "'" & time() & "'"
sSQL = sSQL & ")"
response.write sSQL & "<br><br>"
' execute the SQL
' now that the log file has been written, tell the client browser to open the requested file
response.write "logging : completed"
When I call it using 'http://development.training.com/submit
it appears that the parameters are being passed in correctly.
You will notice some lines (commented out) in which I read from the database. When those lines were active, they should that the database location & name & fields were all correct, since I had no trouble READING from that database.
Can any spot what I am doing wrong? This is really getting frustrating! Worse than teleconferences!