ASP网站制作之关于0x80040e14毛病
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全毛病为何我会失掉一个0x80040e14的毛病信息?ThiserroristhrownupbytheunderlyingOLEDBProvider.Theactualerrormessageis:
Thecommandcontainedoneormoreerrors
TheerrormessagethatyouseeonthescreenwillvarydependingontheMDACthatyouhaveinstalledandtheactualcauseoftheerror.
Thereareanumberofpossiblecauses:
Scenario1-SyntaxerrorinFROMclause
Scenario2a-SyntaxerrorinINSERTINTOstatement
Scenario2b-SyntaxerrorinUPDATEstatement
Scenario3a-Syntaxerror(missingoperator)-causedbymark
Scenario3b-Syntaxerror(missingoperator)-incorrectdelimiters
Scenario4-Syntaxerror-divisionbyzeroerror
Scenario1-SyntaxerrorinFROMclause
Thiscommonlyoccurswhenyouhaveatablenamethatisareservedwordoryourtablenamecontainsaspace(eg"table1").
Certainwords(liketable,field,date,select,password,leveletc)arereservedbyeitherADO,OLEDBorbyAccessforuseascommandsorsystemobjects.
YoucangetalistofreservedwordsinAccessfromtheonlinehelp.TheMicrosoftPlatformSDKoutlinesADO/OLEDBreservedwords.
Youshouldneverusethesewordsasnamesfortablesorfieldsnorshouldyouhavespacesinyourtablenames.Itisrecommendedthatyourenameyouroffendingtables/fieldsandadjustyourSQLstatementaccordingly.
Ifthisisnotpossibleyoushouldencloseyouroffendingtablenameswith[]marks,eg
SELECTfield1
FROM
Scenario2a-SyntaxerrorinINSERTINTOstatement.
Thiscommonlyoccurswhenyourfieldnameisareservedword(seescenario1above).AdjustyourfieldnamesandSQLstatementaccordinglyandyoushouldavoidtheproblem.
Ifyoucantadjustyourfieldnamesyoucanuse[]markstodelimitthefieldnames,eg
INSERTINTOtable1
(,)
VALUES(value1,value2)
Scenario2b-SyntaxerrorinUPDATEstatement.
ThishasthesamecauseasScenario2aimmediatelyabove.
Scenario3a-SyntaxError(MissingOperator)
ThisiscommonlycausedwhensomevaluethatyouaretryingtoSELECT/UPDATEetccontainsasinglequotemark.Theerrorthatyoureceivelookslike:
MicrosoftJETDatabaseEngine(0x80040e14)
Syntaxerror(missingoperator)inqueryexpressionName=OMalleys.
BecauseofthepresenceoftheinthenameOMalleysthedatabaseenginethinksthatyouareconstructingaWHEREclauselike:
WHEREname=O
anddoesntknowwhattodowiththerestofthename(Malleys).TosolvethisproblemyouneedtousetheReplace()functionandreplaceallsinglequoteswithtwosinglequotes.ItisrecommendedthatyouputtheReplace()functionaboveintoauser-definedfunctionandcallasnecessarywithinyourpage.Clickhereforanexampleofsuchafunction.
Scenario3b-SyntaxError(MissingOperator)-incorrectdelimiters
ThiserrorcanalsobecausedwhenattemptinganINSERTorUPDATESQLstatementandyouhaveusedincorrectdelimiters.
FieldType(Access)FieldType(SQLServer)Delimiter
TextChar,varChar
NumericAnynumerictype<none>
Date/TimeAnyDate/Time#(Access),(SQLServer)
UPDATEtable1
SETsomeTextField=someTextValue,
someNumericField=5
someDateField=#01/01/2000#
Scenario4-DivisionbyZero
Datesneedtobedelimitedwith#markswhenpassedtotheJetDatabaseEngine.Thismarksthemasadateliteral.Accessthentakestheliteraldateandconvertsitintoanumber.Alternatively,youcanpassanintegertoAccess,andAccesswillconstructadatebasedonthatnumber.
Howeverifyoudothis:
SELECTfield1
FROMtable1
WHEREfield1=01/01/00
Accesswilltreatthisasaninteger-namely1dividedby1dividedby0,resultinginadivisionbyzeroerror.InsteadyouneedtowriteyourSELECTqueryas:
SELECTfield1
FROMtable1
WHEREfield1=#01/01/00#
</p>缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 它可通过内置的组件实现更强大的功能,如使用A-DO可以轻松地访问数据库。 Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件 代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。 代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。 哪些内置对象是可以跳过的,或者哪些属性和方法是用不到的? 用户端的浏览器不需要提供任何别的支持,这样大提高了用户与服务器之间的交互的速度。 先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习 代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。
页:
[1]