 |
|
มันเกิด error ของ asp อ่ะครับ รบกวนด้วยนะครับ Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. |
|
 |
|
|
 |
 |
|
Code (ASP)
<% Option Explicit %>
<html>
<head>
<title>บันทึกเรียบร้อยแล้ว</title>
<meta name="generator" content="Namo WebEditor">
</head>
<body>
<%
Dim Conn,strSQL,objExec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("plan_follow.mdb"),"" , ""
strSQL = "UPDATE october SET "
strSQL = strSQL&"number = '"&Request.Form("txtnumber")&"' "
strSQL = strSQL&",project = '"&Request.Form("txtproject")&"' "
strSQL = strSQL&",kpi = '"&Request.Form("txtkpi")&"' "
strSQL = strSQL&",type_kpi = '"&Request.Form("txttype_kpi")&"' "
strSQL = strSQL&",goal = '"&Request.Form("txtgoal")&"' "
strSQL = strSQL&",done_job = '"&Request.Form("txtdone_job")&"' "
strSQL = strSQL&"WHERE number = '"&Request.QueryString("numb")&"' "
Set objExec = Conn.Execute(strSQL)
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
%>
</body>
</html>
ผมใช้ code นี้อ่ะครับ พอนำไปรับที่ server แล้วมันฟ้องว่า
Code
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/office/csc/AspAccessEditRecordSave.asp, line 20
ไงก็รบกวนด้วยนะครับ ขอบคุณล่วงหน้า
Tag : ASP, Ms Access
|
|
 |
 |
 |
 |
Date :
2010-12-14 13:34:49 |
By :
pong_1999 |
View :
4161 |
Reply :
12 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
strSQL = strSQL&"WHERE [number] = '"&Request.QueryString("numb")&"' "
|
 |
 |
 |
 |
Date :
2010-12-14 13:56:46 |
By :
.... |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ก็ยังเหมือนเดิมอ่ะครับผม
|
 |
 |
 |
 |
Date :
2010-12-14 14:01:13 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (ASP)
Response.write strSQL
Set objExec = Conn.Execute(strSQL)
ลองเอา SQL Statement มาให้ดูหน่อยครับ
|
 |
 |
 |
 |
Date :
2010-12-14 14:03:41 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (ASP)
Dim Conn,strSQL,objExec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("plan_follow.mdb"),"" , ""
strSQL = "UPDATE octobe SET "
strSQL = strSQL&"number = '"&Request.Form("txtnumb")&"' "
strSQL = strSQL&",project = '"&Request.Form("txtproject")&"' "
strSQL = strSQL&",kpi = '"&Request.Form("txtkpi")&"' "
strSQL = strSQL&",type_kpi = '"&Request.Form("txttype_kpi")&"' "
strSQL = strSQL&",goal = '"&Request.Form("txtgoal")&"' "
strSQL = strSQL&",done_job = '"&Request.Form("done_job")&"' "
strSQL = strSQL&"WHERE [number] = '"&Request.QueryString("numb")&"' "
Set objExec = Conn.Execute(strSQL)
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
นี่ป่ะครับ
|
 |
 |
 |
 |
Date :
2010-12-14 14:05:37 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมให้ write sql มาให้ดูครับ 
|
 |
 |
 |
 |
Date :
2010-12-14 14:07:41 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอโทษจริง ๆ นะครับ ว่าจะต้องทำไง ไม่ทราบจริง ๆ
|
 |
 |
 |
 |
Date :
2010-12-14 14:09:20 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (ASP)
Response.write strSQL
Set objExec = Conn.Execute(strSQL)
เอาบรรทัด Response.write strSQL ไปไว้ก่อนเหมือนตัวอย่างครับ แล้วมันจะทำการ write sql ออกมาครับ
|
 |
 |
 |
 |
Date :
2010-12-14 14:13:11 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้ตามนี้ครับ
UPDATE october SET number = '10' ,project = '' ,kpi = '' ,type_kpi = '' ,goal = '' ,done_job = '' WHERE [number] = '10'
|
 |
 |
 |
 |
Date :
2010-12-14 14:17:15 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (ASP)
strSQL = strSQL&" [number] = '"&Request.Form("txtnumb")&"' "
ลองดูน่ะครับ 
|
 |
 |
 |
 |
Date :
2010-12-14 14:20:23 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วนะครับ ขอบคุณมาก ๆ เลยนะครับ ที่ช่วยเหลือ
ขอให้เก่ง ๆ ขึ้นอีกนะครับ ผมจะได้มาถามอีก
ไงถ้ามีปัญหาอีก คนจะรบกวนอีกนะครับ ขอบคุณมาก ๆ mr.win
|
 |
 |
 |
 |
Date :
2010-12-14 14:29:18 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เข้าใจว่า number มันเป็นคำสงวนน่ะครับ ถ้าเป็นคำสงวนจะต้องครอบด้วย [] ครับ
|
 |
 |
 |
 |
Date :
2010-12-14 14:31:49 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับผม จะได้จำไว้ใช้บ้าง ขอบคุณคร๊าบ
|
 |
 |
 |
 |
Date :
2010-12-14 14:38:45 |
By :
pong_1999 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|