|
|
|
ASP + Access ทำการอัพเดทค่าข้อมูลสำเร็จแต่ค่าไม่เปลี่ยนให้อ่าคับ |
|
|
|
|
|
|
|
Code (ASP)
<% Option Explicit %>
<html>
<head>
<title>Save Record Cisco</title>
</head>
<body>
<%
Response.write("Not found ID="&Request.QueryString("CusID1"))
Response.write("Not found ID="&Request.QueryString("CusID2"))
Dim Conn,strSQL,objExec,strSQL2,objExec2
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("mydatabase.mdb"),"" , ""
strSQL = "UPDATE MyTable SET "
strSQL = strSQL&" IP = '"&Request.Form("txtIP")&"' "
strSQL = strSQL&",Version = '"&Request.Form("txtVersion")&"' "
strSQL = strSQL&",SwImage = '"&Request.Form("txtSwImage")&"' "
strSQL = strSQL&",Port = '"&Request.Form("txtPort")&"' "
strSQL = strSQL&",Status = '"&Request.Form("txtStatus")&"' "
strSQL = strSQL&",Description = '"&Request.Form("txtDescription")&"' "
strSQL = strSQL&" where (IP= '"&Request.QueryString("CusID1")&"' and Port= '"&Request.QueryString("CusID2")&"' )"
Set objExec = Conn.Execute(strSQL)
strSQL2 = "UPDATE Table1 SET "
strSQL2 = strSQL2&" IP = '"&Request.Form("txtIP")&"' "
strSQL2 = strSQL2&",Equipment_Name = '"&Request.Form("txtEquipment_Name")&"' "
strSQL2 = strSQL2&" where (IP= '"&Request.QueryString("CusID1")&"') "
Set objExec2 = Conn.Execute(strSQL2)
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>
Tag : ASP
|
|
|
|
|
|
Date :
2013-05-15 10:27:44 |
By :
solskjaer16 |
View :
1209 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Response.write strSQL2
เอา SQL ออกมาดูหน่อยครับ
|
|
|
|
|
Date :
2013-05-15 10:40:29 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คุณก็รู้สาเหตุแล้วน่ะครับ
|
|
|
|
|
Date :
2013-05-15 15:57:51 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2013-05-16 06:17:45 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|