ทำการแก้ไขฟอร์มอัพโหลดค่ะ โดยมี Element อื่นๆด้วย เมื่อทำการส่งค่าผ่าน id=request.QueryString("sap_id") แล้วระบบฟ้อง Error ดังนี้
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 5.1 Driver][mysqld-5.0.45-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') = '' WHERE sap_id = '530000006'' at line 1
/FixIT_3/admincp/admin_sap/Admin_result_formComPsap.asp, line 55
หน้ารับค่าค่ะ
Code (ASP)
Dim a,b,c,d,e,f,g,testVare
a=DatePart("yyyy",Date())
b=DatePart("m",Date())
c=DatePart("d",Date())
d=DatePart("ww",Date())
e=Hour(Now())
f=Minute(Now())
g=Second(Now())
testVare=a&b&c&d&e&f&g
Dim mySmartUpload
Dim Conn,strSQL,objExec,id
'*** Create Object ***'
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
'*** Upload Files ***'
mySmartUpload.Upload
'*** Upload file1 ***'
If mySmartUpload.Files("sap_re_pb").FileName <>"" Then
mySmartUpload.Files("sap_re_pb").SaveAs(Server.MapPath("AdminFiles/" &testVare& mySmartUpload.Files("sap_re_pb").FileName))
Response.write mySmartUpload.Files("sap_re_pb").Name & " Uploaded.<br>"
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost;UID=root; " & _
"pwd=root;database=tknrepair;option=16384;"
strSQL = "UPDATE job_sap SET "
strSQL = strSQL&"sap_re_pb = '"&testVare&mySmartUpload.Files("sap_re_pb").FileName&"' "
strSQL = strSQL&",sap_it_comment = '"&mySmartUpload.Form("sap_it_comment")&"' "
strSQL = strSQL&",sap_date_final = '"&mySmartUpload.Form("sap_date_final")&"' "
strSQL = strSQL&",sap_time_final = '"&mySmartUpload.Form("sap_time_final")&"' "
strSQL = strSQL&",sap_status) = '"&mySmartUpload.Form("sap_status)")&"' "
strSQL = strSQL&"WHERE sap_id = '"&mySmartUpload.Form("SAP_ID")&"' "
Set objExec = Conn.Execute(strSQL) ====>> line 55
If Err.Number = 0 Then
Response.write("Save Done.")
Else
Response.write("Error Save ["&strSQL&"] ("&Err.Description&")")
End IF
Conn.Close()
Set objExec = Nothing
Set Conn = Nothing
else
Response.Redirect "Admin_formComPsap.asp?errtext= Plest Attach File PB"
end if
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 5.1 Driver][mysqld-5.0.45-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(sap_status = 'ดำเนินการเสร็จสิ้น' ,sap_re_p' at line 1