|
|
|
<ได้แล้วครับขอบคุณครับ>รันไม่ผ่านเลยครับ รบกวนทุกท่านชี้แนะทีคับ |
|
|
|
|
|
|
|
รันไม่ผ่านเลยครับ รบกวนทุกท่านชี้แนะทีคับ
output
page_form.asp
Code (ASP)
<% Option Explicit %>
<html>
<head>
</head>
<body>
<!--#include file="bar.asp"-->
<!--#include file="config.asp"-->
<%
Dim Conn,strSQL,objRec
strSQL = "SELECT * FROM School "
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
%>
<table width="600" border="1">
<tr>
<th width="180"> <div align="center">Code </div></th>
<th width="100%"> <div align="center">SchoolName </div></th>
<th width="198"> <div align="center">Amphur </div></th>
<th width="200"> <div align="center">Zone </div></th>
<th width="70"> <div align="center">CourseStatus </div></th>
<th width="70"> <div align="center">RegStatus </div></th>
<th width="71"> <div align="center">Edit </div></th>
</tr>
<%
While Not objRec.EOF
%>
<tr>
<td><div align="center"><%=objRec.Fields("Code").Value%></div></td>
<td><%=objRec.Fields("SchoolName").Value%></td>
<td><%=objRec.Fields("Amphur").Value%></td>
<td><div align="center"><%=objRec.Fields("Zone").Value%></div></td>
<td align="right"><%=objRec.Fields("CourseStatus").Value%></td>
<td align="right"><%=objRec.Fields("RegStatus").Value%></td>
<td align="center"><a href="AspAccessEditRecordForm.asp?CusID=<%=objRec.Fields("Code").Value%>">Edit</a></td>
</tr>
<%
objRec.MoveNext
Wend
%>
</table>
<%
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</body>
</html>
AspAccessEditRecordForm.asp
Code (ASP)
<% Option Explicit %>
<html>
<head>
</head>
<body>
<!--#include file="bar.asp"-->
<!--#include file="config.asp"-->
<form action="AspAccessEditRecordSave.asp?CusID=<%=Request.QueryString("CusID")%>" name="frmEdit" method="post">
<%
Dim Conn,strSQL,objRec
Set Conn = Server.Createobject("ADODB.Connection")
strSQL = "SELECT * FROM School WHERE Code = '"&Request.QueryString("CusID")&"' "
Set objRec = Conn.Execute(strSQL)
If objRec.EOF Then
Response.write("Not found Code="&Request.QueryString("CusID"))
Else
%>
<table width="600" border="1">
<tr>
<th width="180"> <div align="center">Code </div></th>
<th width="100%"> <div align="center">SchoolName </div></th>
<th width="198"> <div align="center">Amphur </div></th>
<th width="200"> <div align="center">Zone </div></th>
<th width="70"> <div align="center">CourseStatus </div></th>
<th width="70"> <div align="center">RegStatus </div></th>
</tr>
<tr>
<td><div align="center"><input type="text" name="txtCode" size="5" value="<%=objRec.Fields("Code")%>"></div></td>
<td><input type="text" name="txtSchoolName" size="20" value="<%=objRec.Fields("SchoolName")%>"></td>
<td><input type="text" name="txtAmphur" size="20" value="<%=objRec.Fields("Amphur")%>"></td>
<td><div align="center"><input type="text" name="txtZone" size="2" value="<%=objRec.Fields("Zone")%>"></div></td>
<td align="right"><input type="text" name="txtCourseStatus" size="5" value="<%=objRec.Fields("CourseStatus")%>"></td>
<td align="right"><input type="text" name="txtRegStatus" size="5" value="<%=objRec.Fields("RegStatus")%>"></td>
</tr>
</table>
<input type="submit" name="submit" value="submit">
<%
End IF
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</form>
</body>
</html>
AspAccessEditRecordSave.asp
Code (ASP)
<% Option Explicit %>
<html>
<head>
</head>
<body>
<!--#include file="bar.asp"-->
<!--#include file="config.asp"-->
<%
Dim Conn,strSQL,objExec
Set Conn = Server.Createobject("ADODB.Connection")
strSQL = "UPDATE School SET "
strSQL = strSQL&"Code = '"&Request.Form("txtCode")&"' "
strSQL = strSQL&",SchoolName = '"&Request.Form("txtSchoolName")&"' "
strSQL = strSQL&",Amphur = '"&Request.Form("txtAmphur")&"' "
strSQL = strSQL&",Zone = '"&Request.Form("txtZone")&"' "
strSQL = strSQL&",CourseStatus = '"&Request.Form("txtCourseStatus")&"' "
strSQL = strSQL&",RegStatus = '"&Request.Form("txtRegStatus")&"' "
strSQL = strSQL&"WHERE Code = '"&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
%>
</body>
</html>
Tag : ASP
|
ประวัติการแก้ไข 2018-03-23 11:07:07 2018-03-23 11:07:49 2018-03-23 11:09:27 2018-03-23 11:11:25 2018-03-23 11:15:56 2018-03-23 11:17:30 2018-03-23 11:19:14 2018-03-23 11:21:18 2018-03-23 11:26:01 2018-03-23 11:52:01
|
|
|
|
|
Date :
2018-03-23 10:09:54 |
By :
หฟฟกด |
View :
2181 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอดู Error หน่อยครับ
|
|
|
|
|
Date :
2018-03-23 11:03:36 |
By :
cre_kiwsan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2018-03-23 13:22:45 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|