Unable to Update
Hi All,
I have created two ASP files(Insert.asp and Update.asp). Let me first explain my setup. I have an Access database with an "AutoNumber" field called "ReferenceNumber." So each time I INSERT a record, the ReferenceNumber will increment by one.
Now, with my Insert.asp page, I insert a record into the Access database. Once I have done that, i want to use the Update.asp page to update that record I have just inserted.
Here is the problem. Every time I do an update to a particular record, a new record is added to the database instead of updating that particular record. Hence, a new ReferenceNumber(AutoNumber) is generated. Below are my codes of the update.asp file. PLEASE HELP!!! I have checked my codes over and over, and they seems right. I just don't know why it cause to generate a new record. It is driving me crazy! Your helps are GREATLY appreciated!!! THANK YOU!!!
incumbentname=Request.form("incumbentname")
analystname=Request.form("analystname")
rnumber=request.form("referencenumber")
Set conn = Server.CreateObject("ADODB.Connection")
cnpath="DBQ=" & server.mappath("classifications_studies.mdb")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
SQLstmt = "UPDATE classificationmain SET "
SQLstmt = SQLstmt & "positionnumber='" & positionnumber & "',"
SQLstmt = SQLstmt & "incumbentname='" & incumbent & "',"
SQLStmt = SQLStmt & " where referencenumber= " & rnumber & ""
|