Microsoft OLE DB Provider for SQL Server 错误 '80040e14'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Microsoft OLE DB Provider for SQL Server 错误 '80040e14'相关的知识,希望对你有一定的参考价值。

网站ACC数据库升级SQL以后,访问首页出现以下提示:
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
列名 'true' 无效。

/index.asp,行 255

254 Set rs= Server.CreateObject("ADODB.Recordset")
255 rs.open sql,conn,1,1
256 if rs.eof and rs.bof then

应该如何解决?麻烦大家啦

方法1
backup
log
dbname
with
no_log
dbcc
shrinkdatabase('dbname')
--dbname为目标数据库,注意单引号是半角的,截断前请为数据库做完全备份
方法2(这个方法在sqlserver2000的环境下做一般能成功,在sqlserver7及以下版本就不一定了):
第一步:
先备份整个数据库以备不测
第二步:
备份结束后,在Query
Analyzer中执行如下的语句:
exec
sp_detach_db
dbname,true
--卸除这个DB在MSSQL中的注册信息
第三步:
到日志的物理文件所在的目录中去删除该日志文件或者将该日志文件移出该目录
第四步:
在Query
Analyzer中执行如下的语句:
exec
sp_attach_single_file_db
dbname,'d:\microsoft
sql
server\mssql\data\dbname_data.mdf'
--以单文件的方式注册该DB,如果成功则MSSQL将自动为这个DB生成一个500K的日志文件。
方法3
第一步:
backup
log
dbname
with
no_log
或者
backup
log
dbname
with
truncate_only
--no_log和truncate_only是在这里是同义的,随便执行哪一句都可以
第二步:
1.收缩特定数据库的所有数据和日志文件,执行
dbcc
shrinkdatabase(dbname,[,target_percent])--dbname是要收缩的数据库名称;target_percent是数据库收缩后的数据库文件中所要的剩余可用空间百分比
2.收缩一次一个特定数据库中的数据或日志文件,执行
dbcc
shrinkfile(file_id,[,target_size])
--file_id是要收缩的文件的标识
(ID)
号,若要获得文件
ID,请使用
FILE_ID
函数或在当前数据库中搜索
sysfiles;target_size是用兆字节表示的所要的文件大小(用整数表示)。如果没有指定,dbcc
shrinkfile
将文件大小减少到默认文件大小。
两个dbcc命令都可以带上参数notruncate或truncateonly,具体意思看联机帮助。
参考技术A 此错误通常是因数据库中字段、对象或变量的名称存在以下一个或多个问题所致:

将保留字用作名称。大多数数据库都有一组保留字。例如,"date"是保留字,因而不能用于数据库中的列名称。
名称中使用特殊字符。特殊字符的示例包括:
. / * : ! # & - ?

在名称中使用空格。
当为数据库中的对象定义了输入掩码并且插入的数据与该掩码不符时,也会出现此错误。

若要解决该问题,在指定数据库中的列名称时,请避免使用"date"、"name"、"select"、"where"和"level"等保留字。另外,请清除空格和特殊字符。本回答被提问者采纳
参考技术B psrmsql="select
TrueName
from
Member_Users
where
UserID="&pssl("sgid")
'1142
查查看是不是这句的SQL=后面的是空了?
很久没碰着玩意儿了
有点陌生
参考技术C 这个错误太泛了!只知道是数据库连接出了问题没有连接得上,在ASP中由驱动报出了错误.
从这一句中只能得到:
你使用的是oledb驱动,但没有顺利连接上数据库!
其他的就不知道了!当然如果你拿这个驱动去连接ACCESS等其他非SQL数据库时也会出现这种问题的!
参考技术D 你把语句写在一行有错么?

Cannot create an instance of OLE DB provider “OraOLEDB.Oracle” for linked server "xxxxxxx"

在SQL SERVER 2008 R2下用Windows 身份认证的登录名创建了一个访问ORACLE数据库的链接服务器xxxxx,测试成功,木有问题,但是其它登录名使用该链接服务器时,报如下错误:

消息 7302,级别 16,状态 1,第 1 行

Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server "xxxxxx".

 

此时需要在“服务器对象”——>“链接服务器”——>“访问接口”下,找到OraOLEDB.Oracle选项,单击右键选择属性,然后在访问接口选项下勾选“允许进程内”(Allow inprocess)。即可解决上面问题,有时候,可能需要重新新建此链接服务器。

clipboard

 

老外给出了一个解决这个问题的步骤,相当详细严谨,几乎面面俱到。可以作为参考学习的好资料:

Ran into this issue where the linked server would work for users who were local admins on the server, but not for anyone else. After many hours of messing around, I managed to fix the problem using the following steps:

  1:Run “dcomcnfg.exe”. Navigate to “Component Services -> Computers -> My Computer -> DCOM Config”. 

  2:Open the properties page of “MSDAINITIALIZE”.

  3:Copy the “Application ID” on the properties page.

  4:Close out of “dcomcnfg”.

  5:Run “regedit”. Navigate to “HKEY_CLASSES_ROOT\\AppID\\{???}” with the ??? representing the application ID you copied in step #3. 

  6:Right click the “{???}” folder and select “Permissions”

  7:Add the local administrators group to the permissions, grant them full control.

  8:Close out of “regedit”.

  9:Reboot the server.

  10:Run “dcomconfig”. Navigate to “Component Services -> Computers -> My Computer -> DCOM Config”. 

  11:Open the properties page of “MSDAINITIALIZE”.

  12:On the “Security” tab, select “Customize” under “Launch and Activation Permissions”, then click the “Edit” button.

  13:Add “Authenticated Users” and grant them all 4 launch and activation permissions.

  14:Close out of “dcomcnfg”.

  15:Find the Oracle install root directory. “E:\\Oracle” in my case.

  16:Edit the security properties of the Oracle root directory. Add “Authenticated Users” and grant them “Read & Execute”, “List folder contents” and “Read” permissions. Apply the new permissions.

  17:Click the “Advanced Permissions” button, then click “Change Permissions”. Select “Replace all child object permissions with inheritable permissions from this object”. Apply the new permissions.

  18:Find the “OraOLEDB.Oracle” provider in SQL Server. Make sure the “Allow Inprocess” parameter is checked.

  19:Reboot the server.

 

以上是关于Microsoft OLE DB Provider for SQL Server 错误 '80040e14'的主要内容,如果未能解决你的问题,请参考以下文章