<% Option Explicit %> <html> <head> <title>ThaiCreate.Com ASP & Microsoft Access Tutorial</title> </head> <body> <% 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) <<---มี error ตรงบรรทัดนี้ครับ 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>
Quote:mydatabase.mdb
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง