HOME > ASP > ASP Forum > ใครรู้บ้างว่า ลบ 2 table ทำไงดี Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] The record cannot be deleted or changed because table 'send_mail' includes related records.
ใครรู้บ้างว่า ลบ 2 table ทำไงดี Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] The record cannot be deleted or changed because table 'send_mail' includes related records.
<%
emp_id = Request.Querystring("emp_id")
Sql="delete from employee where emp_id="& emp_id
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("test_project_update.mdb"))
set rs=conn.execute(sql)
Sql2="delete from user where id="& emp_id
set rs2=conn.execute(sql2)
Sql3="delete from extra where id_extra="& emp_id
set rs3=conn.execute(sql3)
emp_id = Request.Querystring("emp_id")
Sql="delete from send_mail where emp_id="& emp_id
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("test_project_update.mdb"))
set rs=conn.execute(sql)
Sql4="delete from send_mail where emp_id="& emp_id
set rs3=conn.execute(sql4)
response.redirect "employee.asp"
%>
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] The record cannot be deleted or changed because table 'send_mail' includes related records.
/program/delete_employee.asp, line 6