|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用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[table]
Scenario2a-SyntaxerrorinINSERTINTOstatement.
Thiscommonlyoccurswhenyourfieldnameisareservedword(seescenario1above).AdjustyourfieldnamesandSQLstatementaccordinglyandyoushouldavoidtheproblem.
Ifyoucantadjustyourfieldnamesyoucanuse[]markstodelimitthefieldnames,eg
INSERTINTOtable1
([field],[password])
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>缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 |
|