|
RogC -> Need help updating a record (1/30/2008 7:10:13)
|
I am updating a basic asp forum, which works, I have created and wonder if the following is possible. I have added two fields in the topic list table in the database, one for the username (LastUSer) and one for the date (LastTime) in which the last reply to the post was updated. The reply section works and creates a new record for the reply post in the reply, but I want to update the record in the topic list table so that the Last User and Last Time fields are updated with the appropiate details. After posting the reply, in which the record is added, I have redirected to another page so that I can update the Topic table with the last updated details but I get the following message: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Extra ) in query expression '(ID = )'. The code I use is: <% ID=request("ID") %> <% LASTUSER=request("LastUser") %> <% LASTTIME=request("LastTime") %> <% Dim DataConn Dim CmdUpdateRecord Dim MYSQL Set DataConn = Server.CreateObject("ADODB.Connection") Set CmdUpdateRecord = Server.CreateObject("ADODB.Recordset") DataConn.Open "DBQ=" & Server.Mappath("../database/forum.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" MYSQL = "SELECT Topic.* FROM Topic WHERE (ID = " & ID & ")" CmdUpdateRecord.Open MYSQL, DataConn, 1, 3 CmdUpdateRecord.Fields("LastUser") = LASTUSER CmdUpdateRecord.Fields("LastTime") = LASTTIME CmdUpdateRecord.Update CmdUpdateRecord.Close Set CmdUpdateRecord = Nothing DataConn.Close Set DataConn = Nothing %> The LastUser and LastTime details are hidden fields that I have attached to the form. Any Ideas?
|
|
|
|