E
Eroswar
Unregistered / Unconfirmed
GUEST, unregistred user!
兄弟帮帮忙我最近在试做一个《新闻发布页》是网络上的一个例子学着做的?
我用的网页制作工具是:Dreamweaver MX 4.0中文版
可不知道为什么我把主要的输入窗口都做好了,最后把数据[绑定]好后,运行
IE浏览,晕~~~!出现了出错页面? 这个问题以烦了我四五天了!兄弟帮帮我吧?
我的页面的[动态页面New.asp]
比如新闻发布的[新闻添加页面]基本样子如下:
----------------------------
新闻标题 | - 输 入 框 - |
----------------------------
新闻出处 | - 输 入 框 - |
----------------------------
| |
|
新闻内容 |-新闻内容输入框-|
|
| |
-----------------------------
|提 交| |重 置|
----------------------------
要是数据不[绑定]就可以在IE里显示[新闻添加页面]的输入窗口,要是数据[绑定]
好就不能在IE里显示[新闻添加页面]的输入窗口了?就出现如下错误!
错误内容如下:
--------------------------------------------------------------------
[BOF EOF問題中文版:ADODB.Field (0x800A0BCD) 可能是 BOF 或 EOF 的值為
True,或目前的記錄已被刪除。所要求的操作需要目前的記錄]
本页无法显示
试图访问的网页出现问题,无法显示。
====================================================
请尝试以下方法:
单击 刷新按钮或者梢候再试。
打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
技术信息(适用于支持人员)
错误类型:
ADODB.Field (0x800A0BCD)
/News/new.asp, 第 167 行
浏览器类型:
Mozilla/4.0 (compatible;
MSIE 5.01;
Windows NT 5.0)
页:
GET /News/new.asp
时间:
2005年4月10日, 12:46:43
详细信息:
Microsoft 支持
=======================================================
--------------------------------------------------------------------
我为了这件事我把电脑的系统都重新安装一下!还是不行???
--------------------------------------------------------------------
我现在初步分析应该是数据集连接的问题吧???因为如上以说明了不[绑定]数据
就可以在IE中显示[新闻添加页面]的输入窗口,现我还是找不到那里数据[绑定]错
误???
如下是全部代码:帮我看看吧!
页面源代码如下:
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="936"%>
<!--#include file="Connections/erosk.asp"
-->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString <> "" then
MM_editAction = MM_editAction &
"?"
&
Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert") = "form1" then
MM_editConnection = MM_erosk_STRING
MM_editTable = "News"
MM_editRedirectUrl = "new.asp"
MM_fieldsStr = "titlek|value|comek|value|contk|value"
MM_columnsStr = "title|',none,''|come|',none,''|cont|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> ""
And Request.QueryString <> "" then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And
Request.QueryString <> "" then
MM_editRedirectUrl = MM_editRedirectUrl &
"?"
&
Request.QueryString
else
MM_editRedirectUrl = MM_editRedirectUrl &
"&"
&
Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert") <> "" then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" then
MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" then
MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" then
MM_emptyVal = ""
If (MM_formVal = "" then
MM_formVal = MM_emptyVal
else
If (MM_altVal <> "" then
MM_formVal = MM_altVal
else
If (MM_delim = "'" then
' escape quotes
MM_formVal = "'"
&
Replace(MM_formVal,"'","''" &
"'"
else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) then
MM_tableValues = MM_tableValues &
","
MM_dbValues = MM_dbValues &
","
End If
MM_tableValues = MM_tableValues &
MM_columns(MM_i)
MM_dbValues = MM_dbValues &
MM_formVal
Next
MM_editQuery = "insert into "
&
MM_editTable &
"
("
&
MM_tableValues &
" values ("
&
MM_dbValues &
""
If (Not MM_abortEdit) then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("id" <> "" then
Recordset1__MMColParam = Request.QueryString("id"
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_erosk_STRING
Recordset1.Source = "SELECT * FROM News WHERE id = "
+
Replace(Recordset1__MMColParam, "'", "''" + "
ORDER BY id ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<title>添加新闻页</title>
<style type="text/css">
<!--
.as1 {
font-family: "宋体";
font-size: 14px;
font-style: normal;
font-weight: bold;
color: #FF9933;
}
-->
</style>
<body>
<form ACTION="<%=MM_editAction%>"
METHOD="POST"
name="form1">
<table width="348"
height="210"
border="1"
align="center">
<tr>
<td width="89"
height="28"
align="center"
class="as1">新闻标题
</td>
<td width="243"><input name="titlek"
type="text"
id="titlek"
value="<%=(Recordset1.Fields.Item("title".Value)%>"></td>
</tr>
<tr>
<td height="26"
align="center"
class="as1">新闻出处</td>
<td height="26"><input name="comek"
type="text"
id="comek"
value="<%=(Recordset1.Fields.Item("come".Value)%>"></td>
</tr>
<tr>
<td height="105"
align="center"
class="as1">新闻内容</td>
<td height="105"><textarea name="contk"
cols="35"
rows="7"
id="contk"><%=(Recordset1.Fields.Item("cont".Value)%></textarea></td>
</tr>
<tr>
<td height="33"
colspan="2"><div align="center">
<input name="tijiao"
type="submit"
id="tijiao"
value="提 交">
<input name="chongzi"
type="reset"
id="chongzi"
value="重 置">
</div>
</tr>
</table>
<input type="hidden"
name="MM_insert"
value="form1">
</form>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
我用的网页制作工具是:Dreamweaver MX 4.0中文版
可不知道为什么我把主要的输入窗口都做好了,最后把数据[绑定]好后,运行
IE浏览,晕~~~!出现了出错页面? 这个问题以烦了我四五天了!兄弟帮帮我吧?
我的页面的[动态页面New.asp]
比如新闻发布的[新闻添加页面]基本样子如下:
----------------------------
新闻标题 | - 输 入 框 - |
----------------------------
新闻出处 | - 输 入 框 - |
----------------------------
| |
|
新闻内容 |-新闻内容输入框-|
|
| |
-----------------------------
|提 交| |重 置|
----------------------------
要是数据不[绑定]就可以在IE里显示[新闻添加页面]的输入窗口,要是数据[绑定]
好就不能在IE里显示[新闻添加页面]的输入窗口了?就出现如下错误!
错误内容如下:
--------------------------------------------------------------------
[BOF EOF問題中文版:ADODB.Field (0x800A0BCD) 可能是 BOF 或 EOF 的值為
True,或目前的記錄已被刪除。所要求的操作需要目前的記錄]
本页无法显示
试图访问的网页出现问题,无法显示。
====================================================
请尝试以下方法:
单击 刷新按钮或者梢候再试。
打开 localhost 主页,然后查找与所需信息相关的链接。
HTTP 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务
技术信息(适用于支持人员)
错误类型:
ADODB.Field (0x800A0BCD)
/News/new.asp, 第 167 行
浏览器类型:
Mozilla/4.0 (compatible;
MSIE 5.01;
Windows NT 5.0)
页:
GET /News/new.asp
时间:
2005年4月10日, 12:46:43
详细信息:
Microsoft 支持
=======================================================
--------------------------------------------------------------------
我为了这件事我把电脑的系统都重新安装一下!还是不行???
--------------------------------------------------------------------
我现在初步分析应该是数据集连接的问题吧???因为如上以说明了不[绑定]数据
就可以在IE中显示[新闻添加页面]的输入窗口,现我还是找不到那里数据[绑定]错
误???
如下是全部代码:帮我看看吧!
页面源代码如下:
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="936"%>
<!--#include file="Connections/erosk.asp"
-->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString <> "" then
MM_editAction = MM_editAction &
"?"
&
Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert") = "form1" then
MM_editConnection = MM_erosk_STRING
MM_editTable = "News"
MM_editRedirectUrl = "new.asp"
MM_fieldsStr = "titlek|value|comek|value|contk|value"
MM_columnsStr = "title|',none,''|come|',none,''|cont|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> ""
And Request.QueryString <> "" then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And
Request.QueryString <> "" then
MM_editRedirectUrl = MM_editRedirectUrl &
"?"
&
Request.QueryString
else
MM_editRedirectUrl = MM_editRedirectUrl &
"&"
&
Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert") <> "" then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" then
MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" then
MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" then
MM_emptyVal = ""
If (MM_formVal = "" then
MM_formVal = MM_emptyVal
else
If (MM_altVal <> "" then
MM_formVal = MM_altVal
else
If (MM_delim = "'" then
' escape quotes
MM_formVal = "'"
&
Replace(MM_formVal,"'","''" &
"'"
else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) then
MM_tableValues = MM_tableValues &
","
MM_dbValues = MM_dbValues &
","
End If
MM_tableValues = MM_tableValues &
MM_columns(MM_i)
MM_dbValues = MM_dbValues &
MM_formVal
Next
MM_editQuery = "insert into "
&
MM_editTable &
"
("
&
MM_tableValues &
" values ("
&
MM_dbValues &
""
If (Not MM_abortEdit) then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "" then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("id" <> "" then
Recordset1__MMColParam = Request.QueryString("id"
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_erosk_STRING
Recordset1.Source = "SELECT * FROM News WHERE id = "
+
Replace(Recordset1__MMColParam, "'", "''" + "
ORDER BY id ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<title>添加新闻页</title>
<style type="text/css">
<!--
.as1 {
font-family: "宋体";
font-size: 14px;
font-style: normal;
font-weight: bold;
color: #FF9933;
}
-->
</style>
<body>
<form ACTION="<%=MM_editAction%>"
METHOD="POST"
name="form1">
<table width="348"
height="210"
border="1"
align="center">
<tr>
<td width="89"
height="28"
align="center"
class="as1">新闻标题
</td>
<td width="243"><input name="titlek"
type="text"
id="titlek"
value="<%=(Recordset1.Fields.Item("title".Value)%>"></td>
</tr>
<tr>
<td height="26"
align="center"
class="as1">新闻出处</td>
<td height="26"><input name="comek"
type="text"
id="comek"
value="<%=(Recordset1.Fields.Item("come".Value)%>"></td>
</tr>
<tr>
<td height="105"
align="center"
class="as1">新闻内容</td>
<td height="105"><textarea name="contk"
cols="35"
rows="7"
id="contk"><%=(Recordset1.Fields.Item("cont".Value)%></textarea></td>
</tr>
<tr>
<td height="33"
colspan="2"><div align="center">
<input name="tijiao"
type="submit"
id="tijiao"
value="提 交">
<input name="chongzi"
type="reset"
id="chongzi"
value="重 置">
</div>
</tr>
</table>
<input type="hidden"
name="MM_insert"
value="form1">
</form>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>