|
|
|
การ update ข้อมูลในฐานข้อมูล เราจะทำยังไงถ้าเราต้องการที่จะ Update ข้อมูลในฐานข้อมูล |
|
|
|
|
|
|
|
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
|
|
|
|
|
Date :
2011-08-12 13:47:13 |
By :
thaicreate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|