|
Kage -> RE: SQL Syntax Error (12/22/2003 17:07:14)
|
The code for the SQL stuff is: <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Update Error Tracking</title> </head> <html> <body> <br><br><br> Updating Data... <br><br><br> <% ' ' ' ' declare all the variables DIM SQL, objRS, objConn, strConn, strID DIM strDate, strPickticket, strClaimNumber, strPartNumber, strReason, strPickedBy, strDatePicked, strWeighedBy, strDateWeighed, strFindings, strInHouseOrClaim_InHouse DIM strInHouseOrClaim_Claim, strQtyCustomerGot, strActualQty, strPartNumIfReceivedWrong, strAmtOverShort, strLocation, strQtyShippedReceived, strComments DIM strCustomer, strPartDescription, strScaleCounted_Yes, strValue, strOrderDropTime, strPickTime, strPackTime, strShipVia, strExportOrder_Yes, strExportOrder_No, strLinesOnPick ' ' ' ' pull all the data from the previous page strDate = Request.Form("Date") strPickticket = Replace(Request.Form("Pickticket"), "'", "''") strClaimNumber = Replace(Request.Form("ClaimNumber"), "'", "''") strPartNumber = Replace(Request.Form("PartNumber"), "'", "''") strReason = Replace(Request.Form("Reason"), "'", "''") strPickedBy = Replace(Request.Form("PickedBy"), "'", "''") strDatePicked = Replace(Request.Form("DatePicked"), "'", "''") strWeighedBy = Replace(Request.Form("WeighedBy"), "'", "''") strDateWeighed = Replace(Request.Form("DateWeighed"), "'", "''") strFindings = Replace(Request.Form("Findings"), "'", "''") strInHouseOrClaim_InHouse = Replace(Request.Form("InHouseOrClaim_In-House"), "'", "''") strInHouseOrClaim_Claim = Replace(Request.Form("InHouseOrClaim_Claim"), "'", "''") strQtyCustomerGot = Replace(Request.Form("QtyCustomerGot"), "'", "''") strActualQty = Replace(Request.Form("ActualQty"), "'", "''") strPartNumIfReceivedWrong = Replace(Request.Form("PartNumIfReceivedWrong"), "'", "''") strAmtOverShort = Replace(Request.Form("AmtOverShort"), "'", "''") strLocation = Replace(Request.Form("Location"), "'", "''") strQtyShippedReceived = Replace(Request.Form("QtyShippedReceived"), "'", "''") strComments = Replace(Request.Form("Comments"), "'", "''") strCustomer = Replace(Request.Form("Customer"), "'", "''") strPartDescription = Replace(Request.Form("PartDescription"), "'", "''") strScaleCounted_Yes = Replace(Request.Form("ScaleCounted_Yes"), "'", "''") strValue = Replace(Request.Form("Value"), "'", "''") strOrderDropTime = Replace(Request.Form("OrderDropTime"), "'", "''") strPickTime = Replace(Request.Form("PickTime"), "'", "''") strPackTime = Replace(Request.Form("PackTime"), "'", "''") strShipVia = Replace(Request.Form("ShipVia"), "'", "''") strExportOrder_Yes = Replace(Request.Form("ExportOrder_Yes"), "'", "''") strExportOrder_No = Replace(Request.Form("ExportOrder_No"), "'", "''") strLinesOnPick = Replace(Request.Form("LinesOnPick"), "'", "''") ' ' ' ' create sql statement SQL = "UPDATE ""Results"" SET " SQL = SQL & ", Date = #" & strDate & "#" SQL = SQL & ", Pickticket = '" & strPickticket & "'" SQL = SQL & ", ClaimNumber = #" & strClaimNumber & "#" SQL = SQL & ", PartNumber = '" & strPartNumber & "'" SQL = SQL & ", Reason = '" & strReason & "'" SQL = SQL & ", PickedBy = '" & strPickedBy & "'" SQL = SQL & ", DatePicked = #" & strDatePicked & "#" SQL = SQL & ", WeighedBy = '" & strWeighedBy & "'" SQL = SQL & ", DateWeighed = #" & strDateWeighed & "#" SQL = SQL & ", Findings = '" & strFindings & "'" SQL = SQL & ", InHouseOrClaim_In-House = '" & strInHouseOrClaim_In-House & "'" SQL = SQL & ", InHouseOrClaim_Claim = '" & strInHouseOrClaim_Claim & "'" SQL = SQL & ", QtyCustomerGot = '" & strQtyCustomerGot & "'" SQL = SQL & ", PartNumIfReceivedWrong = '" & strPartNumIfReceivedWrong & "'" SQL = SQL & ", AmtOverShort = '" & strAmtOverShort & "'" SQL = SQL & ", Location = '" & strLocation & "'" SQL = SQL & ", QtyShippedReceived = '" & strQtyShippedReceived & "'" SQL = SQL & ", Comments = '" & strComments & "'" SQL = SQL & ", Customer = '" & strCustomer & "'" SQL = SQL & ", PartDescription = '" & strPartDescription & "'" SQL = SQL & ", ScaleCounted_Yes = '" & strScaleCounted_Yes & "'" SQL = SQL & ", Value = '" & strValue & "'" SQL = SQL & ", OrderDropTime = '" & strOrderDropTime & "'" SQL = SQL & ", PickTime = '" & strPickTime & "'" SQL = SQL & ", PackTime = '" & strPackTime & "'" SQL = SQL & ", ShipVia = '" & strShipVia & "'" SQL = SQL & ", ExportOrder_Yes = '" & strExportOrder_Yes & "'" SQL = SQL & ", ExportOrder_No = '" & strExportOrder_No & "'" SQL = SQL & ", LinesOnPick = '" & strLinesOnPick & "'" SQL = SQL & ", DayOfWeek = '" & strDayOfWeek & "'" ' ' ' ' finish the sql statement SQL = SQL & " WHERE PickTicket = " & strPickTicket & "" ' ' ' ' creates a connection object Set objConn = Server.CreateObject("ADODB.Connection") ' ' ' ' identifies the database and tells the computer where to store the data strConn = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("/fpdb/ErrorTracking.mdb") ' ' ' ' opens the database objConn.Open strConn ' ' ' ' creates the recordset Set objRS = Server.CreateObject("ADODB.Recordset") ' ' ' ' executes the sql statement Set objRS = objConn.Execute (SQL) ' ' ' ' clears the memory buffer Set objRS = Nothing Set objConn = Nothing %> <!-- BEGIN FORM --> <form METHOD="POST" ACTION="findID2.asp" name="FrontPage_Form1"> </form> <!-- END FORM --> <!-- Javascript code that automatically forces the form to submit --> <script language="javascript"> document.UpdateErrorTracking.submit(); </script> </body> </html> </body> </html> any ideas? [sm=help.gif]
|
|
|
|