Passing variables with VBcript
February 7, 2006 12:00 AM
Hello, I'm using VBscript in a .asp file to try and pass Lectora 2005 sp4 quiz data to an access DB on our web server. I've set the security so all users can modify the database, but I still keep getting the http 500 errors when trying to post the data. Can anyone see anything obvious in my script below?<%@ Language=VBScript %> <% DIM scoreDIM timeDIM dateDIM title'Get the parameters posted from the lectora test titled "Final"' score=Request.form("Final_Score") time=Request.form("VarElapsedTime") date=Request.form("VarCurrentDate") title=Request.form("VarCurrentTitleName") 'First create Connection and Recordset objects' Set MyConn =Server.CreateObject("ADODB.Connection") MyConn.Open "DSN=c:program filescommon filesodbcdata sourcesmyTable_dsn" Set Rs = Server.CreateObject("ADODB.RecordSet") 'Now, create the SQL statement' sSQL = "INSERT INTO MAIN(Score,time,date,title) VALUES ( '" & score & ", " & time & ", " & date & ", '" & title & ")" 'Execute the SQL statement, and set the recordset object to the result of this execution. We obtain the resulting records in Rs object' Set Rs = MyConn.Execute(sSQL) 'Close the Recordset object and destroy it' Set Rs = Nothing 'Release the resources for connection object' MYConn.Close Set MyConn = Nothing%> Thank you in advance for any advice!!
Discussions have been disabled for this post