ADODB.Recordset错误'800a0bb9':参数的错误类型 [英] ADODB.Recordset error '800a0bb9' : Arguments are of the wrong type
问题描述
Set rsPlanID = Server.CreateObject("ADODB.Recordset")
rsPlanID.CursorLocation = adUseClient
strSQL = "SELECT PlanID FROM ATTJournals WHERE ATTUserDataID = " & ATTUserDataID
rsPlanID.Open strSQL, m_objConn, adOpenStatic, adLockOptimistic
If Not rsPlanID.EOF Then
response.Write "New PlanID:" & rsPlanID("PlanID")
End If
以上code是在传统的ASP。
The above code is in classic asp.
我收到以下错误:
ADODB.Recordset错误'800a0bb9'结果
参数的错误类型,超出可接受的范围,或有冲突彼此。
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
道兴任何人都知道的原因这个错误,以及如何解决它?
Dows anyone know the cause this error and how to fix it?
推荐答案
最喜欢的原因是,你还没有列入ADOVBS.INC或equavalent META: -
The most like cause is that you haven't included "ADOVBS.INC" or the equavalent META:-
<!--METADATA
TYPE="TypeLib"
NAME="Microsoft ActiveX Data Objects 2.6 Library"
UUID="{00000206-0000-0010-8000-00AA006D2EA4}"
VERSION="2.6"
-->
因此, adxxxx
不存在常量。然而主的错误是不包括选项显式
上方你的脚本。这将节省您斗猎愚蠢的错误和错别字大量的时间。
Hence the adxxxx
constants do not exist. However your primary mistake is not including Option Explicit
at the top your script. This will save you bucket loads of time hunting silly mistakes and typos.
BTW会发生什么,如果 ATTUserDataID
载0; DELETE ATTJournals; ?结果
避免使用级联像瘟疫撰写SQL。搜索ASP SQL注入中找到使用参数化的命令对象,而不是的例子。
BTW What happens if ATTUserDataID
contained "0; DELETE ATTJournals;" ?
Avoid composing SQL using concatenation like the plague. Search for "ASP SQL Injection" to find examples of using parameterised command objects instead.
这篇关于ADODB.Recordset错误'800a0bb9':参数的错误类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!