ADODB.Field (0x80020009) Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. มัน error ว่า ลองเทียบกับที่เคยทำมา
<%' Get the Place ID
plcID = Request( "pid" )
' Open the Database Connection
Set Con = Server.CreateObject( "ADODB.Connection" )
openStr = "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("db\Addlst.mdb")
Con.Open openStr,"",""
' Open the Recordset
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.CursorType = 3
RS.Open "SELECT * FROM Added WHERE PlaceName='" & plcID & "'"
'request.querystring RS
IF NOT RS.EOF THEN
plcNme = RS( "PlaceName" )
plcMgr = RS( "Manager" )
plcPos = RS( "Position" )
plcCou = RS( "Country" )
plcAd1 = RS( "Address1" )
plcAd2 = RS( "Address2" )
plcCit = RS( "City" )
plcStt = RS( "State" )
plcZip = RS( "Zip" )
plcPh1 = RS( "Phone1" )
plcPh2 = RS( "Phone2" )
plcFax = RS( "Fax" )
plcEma = RS( "Email" )
plcWeb = RS( "Website" )
plcOpn = RS( "Day" )
plcTme = RS( "Time" )
plcCls = RS( "Close" )
plcAlc = RS( "Alcohol" )
plcStu = RS( "Status" )
plcDes = RS( "Description" )
plcImg = RS( "Image" )
END IF
FUNCTION SELECTED( firstVal, secondVal )
IF cSTR( firstVal ) = cSTR( secondVAL ) THEN
SELECTED = " SELECTED "
END IF
END FUNCTION
%>
<html><head><title>Update</title></head>
<body bgcolor="gray"><center>
<form method="post" action="mngplc.asp">
<table width="600" border=1 bgcolor="lightyellow" cellpadding="4" cellspacing="0">
<tr>
<td width="100%" colspan="3" height="100" valign="top" align="left" bgcolor="#ffcccc" background="image/namelogo3.gif"></td>
</tr>
<tr>
<td width="100%" colspan="3" height="5%" bgcolor="#ffffcc">Time :<%=((now))%></td>
</tr>
<tr><td colspan="4" bgcolor="yellow">
<font face="Arial" size="3"><b>Update Place</b></font></td></tr>
<tr><td><b> Place Name:</b> </td>
<td colspan="3"><input name="plcNme" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcNme )%>"> </td></tr>
<tr><td><b>Place Manager:</b></td>
<td><input name="plcMgr" size="12" value="<%=plcMgr%>"></td>
<td>Manager's Position</td>
<td ><input name="plcPos" size="12" value="<%=( plcPos )%>"></td>
</tr>
<tr><td><b>Country:</b></td>
<td colspan="3"><input name="plcCou" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcCou )%>"></td></tr>
<tr><td><b>Address1:</b></td>
<td colspan="3"><input name="plcAd1" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcAd1 )%>"> </td></tr>
<tr><td><b>Address2:</b></td>
<td colspan="3"><input name="plcAd2" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcAd2 )%>"> </td></tr>
<tr><td><b>City:</b></td>
<td colspan="3"><input name="plcCit" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcCit )%>"> </td></tr>
<tr><td><b>State:</b></td>
<td colspan="3"><input name="plcStt" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcStt )%>"> </td></tr>
<tr><td><b>Zip:</b></td>
<td colspan="3"><input name="plcZip" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcZip )%>"> </td></tr>
<tr><td><b>Phone1:</b></td>
<td colspan="3"><input name="plcPh1" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcPh1 )%>"> </td></tr>
<tr><td><b>Phone2:</b></td>
<td colspan="3"><input name="plcPh2" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcPh2 )%>"> </td></tr>
<tr><td><b>Fax:</b></td>
<td colspan="3"><input name="plcFax" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcFax )%>"> </td></tr>
<tr><td><b>Email:</b></td>
<td colspan="3"><input name="plcEma" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcEma )%>"> </td></tr>
<tr><td><b>Website:</b></td>
<td colspan="3"><input name="plcWeb" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcWeb )%>"> </td></tr>
<tr><td><b>Open Day:</b></td>
<td colspan="3"><input name="plcOpn" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcOpn )%>"> </td></tr>
<tr><td><b>Open Time:</b></td>
<td colspan="3"><input name="plcTme" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcTme )%>"> </td></tr>
<tr><td><b>Close:</b></td>
<td colspan="3"><input name="plcCls" size="50" maxlength="50"
value="<%=Server.HTMLEncode( plcCls )%>"> </td></tr>
<tr><td><b>Description:</b></td>
<td colspan="3"> <textarea name="plcDes" cols="50" rows="2"
wrap="virtual"><%=Server.HTMLEncode( plcDes )%></textarea></td></tr>
<tr><td bgcolor="#00ffff"><b>
<% if plcImg <> "?????" then%>
<img src="Images\<%=RS("Image")%> "BORDER="0" ALIGN="MIDDLE" WIDTH="200" HEIGHT="150" HSPACE="1" ALT="<%=Server.HTMLEncode( productPicture )%>">
<% else %>
Place Full Description:
<% end if%>
</b></td></tr>
<tr><td><b>Alcohol:</b></td>
<td><select name="plcAlc">
<option value="0" <%=SELECTED( "0", plcAlc )%>>BYO
<option value="1" <%=SELECTED( "1", plcAlc )%>>Licensed
<option value="2" <%=SELECTED( "2", plcAlc )%>>BYO and Licensed</select></td>
<td>Status:</td>
<td><select name="plcStu">
<option value="0" <%=SELECTED( "0", plcStu )%>>Eat in
<option value="1" <%=SELECTED( "1", plcStu )%>>Take away
<option value="2" <%=SELECTED( "2", plcStu )%>>Eat in and Take away</select></td></tr>
<tr><td colspan="4" align="right" bgcolor="#ffff00"><input type="submit" value="Update Product"></td></tr>
</table>
</center>
<%' Close the Recordset
RS.Close%>
<input name="plcID" type="hidden" value="<%=plcID%>">
<input name="edtplc" type="hidden" value="1"></form>
</body></html>
======================
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
มัน error ว่า ลองเทียบกับที่เคยทำมา มันก็ยังหาไม่เจอสักที ช่วยดูหน่อยนะคะ
Tag : - - - -
Date :
23 ส.ค. 2548 19:37:08
By :
piangw
View :
3117
Reply :
3
เคยเจอ error นี้เหมือนกัน แต่จำไม่ได้แล้วว่าเพราะอะไร ไม่ทราบว่าตอนทำนี่เปิด db อยู่ด้วยหรือเปล่า ถ้าเปิดก้อลองปิดแล้วรันใหม่ดู
Date :
24 ส.ค. 2548 09:39:33
By :
ทศ
RS.Open "SELECT * FROM Added WHERE PlaceName='" & plcID & "'"
ตัวแปรน่าจะไม่มีค่านะครับ
Date :
24 ส.ค. 2548 10:01:39
By :
@W_IN
plcID = Request( "pid" )
request แบบนี้มีด้วยเหรอครับ ผมไม่เคยเห็น เคยเห็นแต่ request.form("pid") or request.querystring("pid")
อะไรประมาณนี้ ถ้า request แบบนี้มี ผู้รู้ช่วยอธิบายวิธีใช้ด้วยครับ ว่าใช้แบบไหน
Date :
24 ส.ค. 2548 20:05:54
By :
akerr
Load balance : Server 01