HOME > ASP > ASP Forum > กรอกข้อมูลแล้ว มันขึ้น error อย่างนี้อะครับ The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.
กรอกข้อมูลแล้ว มันขึ้น error อย่างนี้อะครับ The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
Code (PHP)
<% 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("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
%>
<br>
<input type="button" onClick="window.location='aspaccesseditrecordlist.asp'" value="กลับสู่หน้าหลัก>>">
</body>
</html>