HOME > ASP > ASP Forum > Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [MySQL][ODBC 3.51 Driver][mysqld-4.0.1-alpha-nt]You have an error in your SQL syntax near
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [MySQL][ODBC 3.51 Driver][mysqld-4.0.1-alpha-nt]You have an error in your SQL syntax near
*----------------------- Show data------------------------------------------------------------------------------
<%
Set Conn=Server.Createobject("ADODB.Connection")
Conn.Open "mysqlsample","srathee","advantage"
sql ="Select * From member"
Set Rs = Conn.Execute(sql)
If Rs.EOF Then
%>
äÁèÁÕ¢éÍÁÙÅã¹µÒÃÒ§ !
<%Else%>
<table width="139" border="1">
<tr bgcolor="Silver">
<td>id</td>
<td>barcode</td>
</tr>
<% While Not Rs.EOF%>
<tr>
<td><a href="del.asp?id=<%=Rs("id")%>"><%= Rs("user")%></a></td>
<td><%= Rs("pass")%></td>
</tr>
<% Rs.MoveNext
Wend
Rs.Close
Conn.Close
End If
%>
</table>
*---------------------------------------- del.asp---------------------------------------------
<%
Set Conn=Server.Createobject("ADODB.Connection")
Conn.Open "mysqlsample","srathee","advantage"
Conn.Execute "DELETE * FROM member where id="&Request.QueryString("id")
Set Rs = Conn.Execute(sql)
Conn.Close
%>
*-----------------------------------------Error------------------------------------------------
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.1-alpha-nt]You have an error in your SQL syntax near '* FROM member where id=1' at line 1
/Temp/del.asp, line 4
ช่วยลบข้อมูลให้หน่อยคับ
MySQL + ASP ไม่สามารถลบข้อมูลได้ครับ หลายวิธีแล้วคับไม่ได้เลย
Tag : - - - -
Date :
16 เม.ย. 2548 17:39:48
By :
M@C
View :
2988
Reply :
1
No. 1
Guest
รู้สึกจะได้แล้วคับแต่ส่งสัยมากเลย
ครั้งที่ 1
<%
Set Conn=Server.Createobject("ADODB.Connection")
Conn.Open "mysqlsample","srathee","advantage"
Conn.Execute "DELETE * FROM member where id="&Request.QueryString("id")
Set Rs = Conn.Execute(sql)
Conn.Close
%>
มันผิดตรงที่มี Set Rs = Conn.Execute(sql) และ DELETE * FROM ( ที่มันมี * )
ลบได้แต่ Error
ครั้งที่ 2
<%
Set Conn=Server.Createobject("ADODB.Connection")
Conn.Open "mysqlsample","srathee","advantage"
Conn.Execute "DELETE FROM member where id="&Request.QueryString("id")
Conn.Close
%>