runningphan
MIS
I have code that executes without errors in Firefox but gives me a duplicate record error in IE and it is driving me crazy. I can't seem to find where the problem is. The form data that is being posted is writing properly to the new database record but for some reason it appears that the ASP code executes again giving me a duplicate record error.
It's in IE v 7 and earlier as well.
Here's the code:
Thanks!
It's in IE v 7 and earlier as well.
Here's the code:
Code:
<%
Dim objConn, objRs, strSQL
Dim workorder, teamcell, contactperson, asset, servicerequested, extension, additionalcontactperson, additionalextension, completiondate, myMail
%>
<%
workorder = Request.Form("workorder")
teamcell = Request.Form("teamcell")
contactperson = Trim(Request.Form("contactperson"))
asset = Request.Form("asset")
servicerequested = Request.Form("servicerequested")
extension = Request.Form("extension")
additionalcontactperson = Trim(Request.Form("additionalcontactperson"))
additionalextension = Request.Form("additionalextension")
completiondate = Request.Form("completiondate")
%>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRs = Server.CreateObject("ADODB.Recordset")
objConn.Open "DSN=MAINT"
strSQL = "SELECT * FROM WORKORDERS"
objRs.CursorType = 2
objRs.LockType = 3
objRs.Open strSQL, objConn
objRs.AddNew
objRs.Fields("Work_Order_Type") = "2"
objRs.Fields("Work_Order") = workorder
objRs.Fields("Status") = "1"
objRs.Fields("Description") = "SERVICE REQUEST"
objRs.Fields("Create_Date") = Now
objRs.Fields("Requested_Start_Date") = Now
objRs.Fields("Requested_End_Date") = completiondate
objRs.Fields("User_Defined_1") = teamcell
objRs.Fields("User_Defined_2") = contactperson
objRs.Fields("User_Defined_3") = additionalcontactperson
objRs.Fields("Instructions") = servicerequested
objRs.Fields("Last_Status_Date") = Now
objRs.Fields("Last_Edited_Date") = Now
objRs.Fields("Created_By") = "SR"
objRs.Fields("Last_Status_By") = "SR"
objRs.Update
objRs.Close
Set objRs = Nothing
Set objConn = Nothing
%>
Thanks!