关于0x80040e14错误

2016-01-29 18:35 110 1 收藏

关于0x80040e14错误,关于0x80040e14错误

【 tulaoshi.com - ASP 】

  为什么我会得到一个0x80040e14的错误信息?

This error is thrown up by the underlying OLEDB Provider. The actual error message is:
The command contained one or more errors
The error message that you see on the screen will vary depending on the MDAC that you have installed and the actual cause of the error.

There are a number of possible causes:
Scenario 1 - Syntax error in FROM clause
Scenario 2a - Syntax error in INSERT INTO statement
Scenario 2b - Syntax error in UPDATE statement
Scenario 3a - Syntax error (missing operator) - caused by ' mark
Scenario 3b - Syntax error (missing operator) - incorrect delimiters
Scenario 4 - Syntax error - division by zero error
Scenario 1 - Syntax error in FROM clause
This commonly occurs when you have a table name that is a reserved word or your table name contains a space (eg "table 1").

Certain words (like table, field, date, select, password, level etc) are reserved by either ADO, OLEDB or by Access for use as commands or system objects.

You can get a list of reserved words in Access from the online help. The Microsoft Platform SDK outlines ADO/OLEDB reserved words.

You should never use these words as names for tables or fields nor should you have spaces in your tablenames. It is recommended that you rename your offending tables/fields and adjust your SQL statement accordingly.

If this is not possible you should enclose your offending table names with [ ] marks, eg
SELECT field1
FROM [table]
Scenario 2a - Syntax error in INSERT INTO statement.
This commonly occurs when your field name is a reserved word (see scenario 1 above). Adjust your field names and SQL statement accordingly and you should avoid the problem.

If you can't adjust your fieldnames you can use [ ] marks to delimit the field names, eg
INSERT INTO table1
([field], [password])
VALUES ('value1', 'value2')
Scenario 2b - Syntax error in UPDATE statement.
This has the same cause as Scenario 2a immediately above.

Scenario 3a - Syntax Error (Missing Operator)
This is commonly caused when some value that you are trying to SELECT/UPDATE etc contains a single quote mark. The error that you receive looks like:
Microsoft JET Database Engine (0x80040e14)
Syntax error (missing operator) in query expression 'Name = 'O'Malleys''.
Because of the presence of the ' in the name O'Malleys the database engine thinks that you are constructing a WHERE clause like:
WHERE name = 'O'
and doesn't know what to do with the rest of the name (Malleys). To solve this problem you need to use the Replace() function and replace all single quotes with two single quotes. It is recommended that you put the Replace() function above into a user-defined function and call as necessary within your page. Click here for an example of such a function.

Scenario 3b - Syntax Error (Missing Operator) - incorrect delimiters
This error can also be caused when attempting an INSERT or UPDATE SQL statement and you have used incorrect delimiters.

Field Type (Access) Field Type (SQL Server) Delimiter
Text Char, varChar '  
Numeric Any numeric type <none  
Date/Time Any Date/Time # (Access), ' (SQL Server)  

UPDATE table1
SET someTextField = 'someTextValue',
someNumericField = 5
someDateField = #01/01/2000#
Scenario 4 - Division by Zero
Dates need to be delimited with # marks when passed to the Jet Database Engine. This marks them as a date literal. Access then takes the literal date and converts it into a number. Alternatively, you can pass an integer to Access, and Access will construct a date based on that number.

However if you do this:
SELECT field1
FROM table1
WHERE field1 = 01/01/00
Access will treat this as an integer - namely 1 divided by 1 divided by 0, resulting in a division by zero error. Instead you need to write your SELECT query as:
SELECT field1
FROM table1
WHERE field1 = #01/01/00

来源:http://www.tulaoshi.com/n/20160129/1506460.html

延伸阅读
标签: windows10
win10电脑开机出现蓝屏,显示错误代码0x00000001e怎么办   Windows电脑的蓝屏故障似乎已经成为了系统的一种习惯,一旦触及到系统某方面的故障,电脑就会出现蓝屏现象,这不,即便是咱们系统版本一再的升级,补丁一再的升级,但是这样的蓝屏故Tulaoshi.Com障似乎还是没有得到解决。这不,升级到win10系统之后,蓝屏的现象还是会出现。...
标签: 电脑入门
在电脑运行时出现蓝屏代码0x0000007F怎么办,别着急,下文为大家介绍其原因及解决方法,希望对大家有帮助。 以上故障提示文字:UNEXPECTED-KERNEL-MODE-TRAP 通常的原因:通常是由于硬件或软件问题导致,但一般都由硬件故障引起的. 解决方法:核对Microsoft硬件兼容性列表以确保所有的硬件和驱动程序都与Windows兼容.如果计算机主板不兼容...
安装windows7系统显示蓝屏错误代码0x0000007E的解决方法   1、从上面的蓝屏代码中,我们可以看到相关的提示,其中说明的是HIDCLASS.SYS表示设备驱动有问题。 2、那么我们可以尝试将连接在电脑上的驱动设备都移除,比如键盘,鼠标等,如果是使用无线鼠标和键盘的话,就把插在usb接口上的无线接收器给移除再进行系统安装即可; ...
标签: 电脑入门
问:最近使用Windows Update时提示0x80248011错误,请问如何解决? 答:可以打开Internet Explorer,依次选择工具菜单→Internet选项,在常规选项卡中单击删除文件按钮,勾选删除所有脱机内容并单击确定,删除所有临时文件。然后单击删除Cookies按钮,并单击确定按钮,删除所有Cookies记录,最后重新启动电脑即可。
标签: windows10
Win10同步邮件应用时出现错误0x80c8043e怎么办   方法一、通过Powershell解决 在Cortana搜索栏输入Powershell后,在第一个结果处点击右键选择以管理员身份运行,然后输入以下命令后回车: Get-appxprovisionedpackage –online | where-object {$_.packagename –like *windowscommunicationsapps*} | remove-...

经验教程

13

收藏

52
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部