网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.如何增强ASP程序性能(2).
.isNull(str), isEmpty(str)和 st.
.ASP,PHP与.NET伪造HTTP-REFERER方.
.用排序串字段实现树状结构(库结.
.解决使用ASP无法连接ORACLE 9i数.
.ADO如何善用RecordSet组件呢?.
.用asp获取文件md5值.
.从手工注入看防御之Access.
.数据分页方法新思路,速度非常快.
.用排序串字段实现树状结构(存储.
.ODBC Drivers错误'80004005'的解.
.针对select写了一个通用的option.
.通过ASP自动解压RAR文件.
.远程连接access数据库的方法.
.asp动态生成wbmp图片的程序.
.关于密码校验.
.网页加速处理-页面减肥与减化.
.ASP+SQL Server之图象数据处理.
.利用ASP获得图象的实际尺寸的示例.
.Varchar与char的区别.

关于0x80040e14错误 

发表日期:2002-2-1


为什么我会得到一个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#  
上一篇:rs的pagesize属性 人气:13628
下一篇:英文的服务器不支持中文及中文数据库的解决办法 人气:10534
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐