|
![](/images/resource/spacer.gif) |
|
การ update ข้อมูลในฐานข้อมูล เราจะทำยังไงถ้าเราต้องการที่จะ Update ข้อมูลในฐานข้อมูล |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code (ASP)
<%
Dim Conn,strSQL,objExec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("mydatabase.mdb"),"" , ""
strSQL = "UPDATE customer SET "
strSQL = strSQL&"CustomerID = '"&Request.Form("txtCustomerID")&"' "
strSQL = strSQL&",Name = '"&Request.Form("txtName")&"' "
strSQL = strSQL&",Email = '"&Request.Form("txtEmail")&"' "
strSQL = strSQL&",CountryCode = '"&Request.Form("txtCountryCode")&"' "
strSQL = strSQL&",Budget = '"&Request.Form("txtBudget")&"' "
strSQL = strSQL&",Used = '"&Request.Form("txtUsed")&"' "
strSQL = strSQL&"WHERE CustomerID = '"&Request.QueryString("CusID")&"' "
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
%>
Go to : ASP Microsoft Access Edit/Update Record
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2011-08-12 13:47:13 |
By :
thaicreate |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 02
|