ADODB.Recordset (0x800A0CB3)是什么错误,Microsoft OLE DB Provider for SQL Server (0x80040E2F)是什么错误?

p559 2003-10-03 11:47:35
ADODB.Recordset (0x800A0CB3)是什么错误?
Microsoft OLE DB Provider for SQL Server (0x80040E2F) 又是什么错误?
...全文
452 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dwzh20 2003-10-03
  • 打赏
  • 举报
回复
SQL Server一般采用ODBC来连接,需要用到数据源,也就是DSN,需要在服务器上配置用户DSN,他不用OLEDB的方法连接,不像ACCESS那样直接可以用字符串动态连接,然后随便找台IIS服务器上放上去便可以运行。当然,SQL server数据库也是可以采用OLEDB技术的,不过好象还要改什么注册表什么的,我不是很清楚了。
changechange 2003-10-03
  • 打赏
  • 举报
回复
产品 | 支持 | 搜索 | Microsoft 指南

--------------------------------------------------------------------------------
免费下载
产品目录
辅助功能
选购指南

--------------------------------------------------------------------------------
BackOffice产品系列
开发工具
Office产品系列
Windows产品系列

--------------------------------------------------------------------------------
技术支持
企业顾问咨询服务
市场活动与讲座
认证与培训
选购指南
微软出版社

--------------------------------------------------------------------------------
搜索 microsoft.com/china

--------------------------------------------------------------------------------
微软(中国)主页
美国总部主页
MSN主页

--------------------------------------------------------------------------------
站点地图
与我们联系
注册个人信息
市场活动与讲座
认证与培训
微软出版社
主页 搜索 常见产品技术问答 下载 新闻组 联系我们

Microsoft Knowledge Base Article - 291014

建议?
如果您对此文章有任何建议或意见,请在下面输入(最多 255 个字)

支持中心
Java Technologies
Visual J++

General Information
联系我们
支持的选项和价格,电话和网上支持

客户服务
客户意见,产品购买,站点和产品信息


页面选项
发送
打印


FIX: Specific Error Messages Not Returned by ADO/WFC
适用于
This article was previously published under Q291014
SYMPTOMS
When using the ActiveX Data Objects for Windows Foundation Classes (ADO/WFC) to access a database, specific error codes are not returned when exceptions are thrown. With ADO 2.5 and 2.6, all errors are returned as the following:

Unknown error(0x800a0cb3)
The exact error code may differ, depending on the cause of the particular problem.
CAUSE
The IErrorInfo interface is not correctly exposed in ADO 2.5 and ADO 2.6. As a result, the WFC classes are unable to get details of the exception, causing WFC to report a more generic error.
RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.6. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
300635 INFO: How to Obtain the Latest MDAC 2.6 Service Pack

Hotfix
The English version of this fix should have the following file attributes or later:
Date Time Version Size File name
-------------------------------------------------------------
02/20/01 20:53 2.61.7219.0 528,656 bytes Msado15.dll
04/11/01 304,128 bytes Q291014_MDAC26_SP1_x86_en.exe

NOTE: This fix should only be applied to computers currently running Microsoft Data Access Components (MDAC) version 2.6. At this time, a fix is not available for MDAC 2.5 computers.

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.
MORE INFORMATION
Steps to Reproduce Behavior
The following Visual J++ code can be used to illustrate the problem: import com.ms.wfc.data.*;
import com.ms.com.*;

public class Class1
{
public static void main (String[] args)
{
try
{
Connection cnConn1 = null;
String strCnn = "Provider=SQLOLEDB;Data Source=MyServer;" +
"Initial Catalog=Pubs;User Id=sa;Password=;";

//Open connection.
cnConn1 = new Connection();
cnConn1.open(strCnn);

//Open recordset.
Recordset rs1 = null;
rs1 = new Recordset();
rs1.open("Employee",
cnConn1,
AdoEnums.CursorType.KEYSET,
AdoEnums.LockType.OPTIMISTIC,
AdoEnums.CommandType.TABLE);

//Try to read from an invalid field.
Variant fieldVal;
fieldVal = rs1.getField("invalidFieldName").getValue();
}
catch( AdoException ae )
{
// Notify user of any errors that result from ADO.
// This prints "Unknown error(0x800a0cc1)".
System.out.println(ae.getMessage());
}
}
}

Before applying the fix, the error described in the "Symptoms" section of this article is displayed when the above code is run.

After the fix has been applied, this code produces the following error instead:

Item cannot be found in the collection corresponding to the requested name or ordinal.
This message is correct, because we are requesting an invalid field name.
The information in this article applies to:
ActiveX Data Objects (ADO) 2.5
ActiveX Data Objects (ADO) 2.6
Microsoft Visual J++ 6.0
Last Reviewed: 10/16/2002 (1.0)
Keywords: kbBug kbDSupport kbMDAC260sp1Fix KB291014





帮助


© 2002 Microsoft Corporation 版权所有.保留所有权利 隐私声明 Microsoft 辅助功能
sunnylake 2003-10-03
  • 打赏
  • 举报
回复
检查你的ODBC连接

28,406

社区成员

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

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