紧急求救:出现了这种错误:Microsoft OLE DB Provider for SQL Server 错误 '80040e21' 应该怎么解决?在线等

angeb 2003-10-17 07:55:46
Microsoft OLE DB Provider for SQL Server 错误 '80040e21'

多步 OLE DB 操作产生错误。请检查每个 OLE DB 状态值。没有工作被完成

一个分页程序,原来数据库只有几条记录时运行的很好,等记录增加到几百条时就出现了如上的错误!应该怎么解决?
...全文
560 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
whb147 2003-10-20
  • 打赏
  • 举报
回复
asp程序错误详细说明例表




文章作者:无 文章来源:knowsky.com  人气:10 添加时间:2003-10-12



平时写程序的时候出错时的解决方法,不太全,但是一般问题应该都有了,呵呵,欢迎大加添加新的错误信息及解决方法
ActiveServerPages,ASP0126(0x80004005)-->找不到包含文件

MicrosoftOLEDBProviderforODBCDrivers(0x80040E21)-->sql语句出错(数据类型不匹配或表名(字段名)错误或表处于编辑状态,或表不存在于conn打开的数据库中)
MicrosoftOLEDBProviderforODBCDrivers(0x80040E14)-->sql语句出错(字段名错误,或数据类型不匹配)
MicrosoftOLEDBProviderforODBCDrivers(0x80040E07)-->sql语句出错(要插入或更新的字段的类型与变量数据类型不匹配)
MicrosoftOLEDBProviderforODBCDrivers(0x80040E57)-->sql语句出错(要插入或更新的数据溢出)
MicrosoftOLEDBProviderforODBCDrivers(0x80040E10)-->sql语句出错(update字段名或要更新的数据类型错误)
MicrosoftOLEDBProviderforODBCDrivers(0x80004005)-->sql语句出错(要插入或更新的字段的数值不能为空值)
MicrosoftOLEDBProviderforODBCDrivers(0x80004005) -->打开数据库出错,没有在指定目录发现数据库
MicrosoftOLEDBProviderforODBCDrivers(0x80040E37)-->没有发现表

MicrosoftVBscript运行时错误(0x800A000D)-->错误引用rs变量(rs对像已关闭或未定义)
MicrosoftVBscript运行时错误(0x800A01C2)-->vbscript脚本错误(vbscript语句出错)
MicrosoftVBscript运行时错误(0x800A0006)-->vbscript脚本错误(溢出错误)
MicrosoftVBscript编译器错误(0x800A040E)-->缺少loop
MicrosoftVBscript编译器错误(0x800A03EA)-->缺少if或endif
MicrosoftVBscript编译器错误(0x800A03EE)--> 语句未结束(缺少")")
MicrosoftVBscript编译器错误(0x800A03F6)-->if语句出错(缺少endif)
MicrosoftVBscript运行时错误(0x800A005B)-->缺少set
MicrosoftVBscript运行时错误(0x800A0005)-->变量未定义
MicrosoftVBscript编译器错误(0x800A03F9)-->if语句缺少then
MicrosoftVBscript编译器错误(0x800A0411)-->dim语句定义错误
MicrosoftVBscript编译器错误(0x800A0408)-->sql语句错误(?????????????????)


ADODB.Recordset(0x800A0BB9)-->sql语句出错(sql语句或conn语句未定义或对一个rs属性进行赋值时发生错误)
ADODB.Recordset(0x800A0CC1)-->rs对像出错(rs对像本身不存在或错误地引用了一个不存在的字段名)
ADODB.Recordset(0x800A0BCD)-->rs对像出错(记录集中没有记录却对记录集进行操作)
ADODB.Recordset(0x800A0E78)-->rs对像出错(记录集不存在,缺少rs.open语句)
ADODB.Recordset(0x800A0CC1) -->rs对像出错(引用了一个不存在的字段名)
ADODB.Recordset(0x800A0E7D)-->conn定义错误
ADODB.Recordset(0x800A0CB3)-->数据库以只读方式打开,无法更新数据
sugle 2003-10-20
  • 打赏
  • 举报
回复
出现过类似的问题,关注一下!
angeb 2003-10-20
  • 打赏
  • 举报
回复
谢谢各位的参与,今天到目前为止没出现问题了,结帖了!
以后出现问题了再请教吧!
fclz2000 2003-10-20
  • 打赏
  • 举报
回复
谢谢whb147(dodo) ,好东东,我也添加一个:


Microsoft VBScript 运行时错误 (0x800A01B6)


错误原因:
set rs=server.create......你少了 set
angeb 2003-10-20
  • 打赏
  • 举报
回复
感谢whb147(dodo) 给我了这么多信息!
可是一般错误不应该是一直存在嘛,为什么我的错误有时有有时又没呢?好奇怪!
angeb 2003-10-19
  • 打赏
  • 举报
回复
没有人遇到过这样的问题吗?
难道我就得结贴了?
aloxy 2003-10-18
  • 打赏
  • 举报
回复
数据库连接超时了
angeb 2003-10-18
  • 打赏
  • 举报
回复
我试过了,可是只有基于OLE DB的可以用。不知道什么问题!
大家来讨论讨论
angeb 2003-10-18
  • 打赏
  • 举报
回复
我试过了,可是只有基于OLE DB
jianchengfine 2003-10-18
  • 打赏
  • 举报
回复
你试着用不同的驱动程序来驱动一下数据库
angeb 2003-10-18
  • 打赏
  • 举报
回复
我重新导入数据库就好了,不过这次记录只有四五十条!数据库不是我建的,而且我只用查询功能,不插入也不修改怎么会有问题呢?我也研究了一下数据库,数据长度和类型都一致呀!也不知道到底是什么问题!

我搜索这个问题的时候,发现很多网站,论坛之类的有时也会出现这种问题!是不是数据库太大就会出状况呀!真是搞不清楚!
angeb 2003-10-18
  • 打赏
  • 举报
回复
谢谢各位,我先看看!看英文还是有点累
makay 2003-10-18
  • 打赏
  • 举报
回复
是你数据类型问题,在你插入时错误,你看一看你各字段的数据类型和插入的一不一致。
skeen 2003-10-18
  • 打赏
  • 举报
回复
应该就是这个问题。
skeen 2003-10-18
  • 打赏
  • 举报
回复
估计你在表中定义的表段小了,而你添加的数据库大于这个表段大小,就出现这个错误。
如你数据库data中的config表长度是5,而你添加数据的时候长度是6,就出错了塞
baby678 2003-10-18
  • 打赏
  • 举报
回复
80040e21 ODBC error with Insert or Update Record server behavior

Issue
A '80040e21' error occurs when using the Update Record or Insert Record Server Behavior.


Solution
This error is related to the database not being able to handle the update or insert the Server Behavior that it is trying to perform. There are several things that may cause this ODBC error.

Many of the possible reasons for this error are listed below:
The Server Behavior is attempting to update or insert into a database table's auto number field. The database can't handle an external input into an Autonumber field. When a record is inserted the autonumber is defined automatically, so when the update or insert behavior tries to place another item into the field it fails.

The data the Server Behavior is updating or inserting is the wrong type for the database field.
For example:
1 Inserting non binary data into a database field that is a yes/no (binary) field.
2 Inserting a string into a database field that has a number data type.
3 Inserting a string into a database field that has a currency or money data type.
4 Inserting a improperly formatted string into a database field that has a date/time data type.
zhgroup 2003-10-17
  • 打赏
  • 举报
回复
我认为这主要是数据库连接的问题。好好看看数据库的连接。
angeb 2003-10-17
  • 打赏
  • 举报
回复
help!
angeb 2003-10-17
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<%
sql= "select * from videotable order by id "
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,1
if not rs.bof and not rs.eof then
dim page_size
dim page_no
dim page_total
page_size=20
if request("page_no")=""then
page_no=1
else
page_no=cint(request("page_no"))
end if
session("page_no")=page_no
rs.pagesize=page_size
page_total=rs.pagecount
rs.absolutepage=page_no
%>
<table border="0">
<tbody>
<tr>
<%
dim i, j
i=0
j=page_size
do while not rs.eof and j>0
i=i+1
j=j-1
'for i=1 to rs.RecordCount
if i>5 and (i-1) mod 5=0 then
%>
<tr>
<td>
<!--#include file="sub.asp"-->
</td>
<%
else
%>
<td>
<!--#include file="sub.asp"-->
</td>
<%
end if
%>
<%
rs.MoveNext
loop
end if
%>
</tr>
</tbody>
</table>
<br><center><font size="-1" >
<%
call select_page(page_no,page_total)
%></font>
</center>

function.asp:
<%
private sub select_page(page_no,total_page)
response.Write"页码:"
dim i
for i=1 to total_page
if i=page_no then
response.Write i &" "
else
response.Write"<a href='index.asp?page_no="&i&"'>"&i&"</a> "
end if
next
end sub
%>

conn.asp:
<%
dim conn
Set conn=Server.CreateObject("ADODB.Connection")
conn.connectiontimeout=0
conn.Open"Provider=SQLOLEDB;Database=bb;Uid=sa;Pwd=1111"
%>

sub.asp是显示的内容

主要的就这些,可能不全
qdubit 2003-10-17
  • 打赏
  • 举报
回复
最好把相关的代码贴出来看看,不然很难说到底是什么问题的。
加载更多回复(2)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧