VBScript中的CreateParameter

VBScript中的CreateParameter,vbscript,ado,Vbscript,Ado,我在执行以下代码时出错。下面是代码 oConn.Open strConnectionString, strUserName, strPassword Set objCommand = CreateObject("ADODB.Command") 'Create and populate the paramaters collection With objCommand .ActiveConnection = oConn .CommandText = "my sp" .CommandTy

我在执行以下代码时出错。下面是代码

oConn.Open strConnectionString, strUserName, strPassword
Set objCommand = CreateObject("ADODB.Command")
'Create and populate the paramaters collection
With objCommand
  .ActiveConnection = oConn
  .CommandText = "my sp"
  .CommandType = 4
  .Parameters.Append .CreateParameter("my parameter", adVarChar, adParamInput, 20, "my value")
  Set objRecordset = .Execute
End With

添加参数时出错。

在纯VBScript中,未定义ad*常量。证据:

>> Set c = CreateObject("ADODB.Command")
>> c.CreateParameter "my parameter", adVarChar, adParamInput, 20, "my value"
>>
Error Number:       3001
Error Description:  Die Argumente sind vom falschen Typ, liegen außerhalb des Gültigkeitsbereiches oder sind miteinander unvereinbar.
>> adVarChar = 200
>> adParamInput = 1
>> c.CreateParameter "my parameter", adVarChar, adParamInput, 20, "my value"
>>
>> (No news are good news)
因此,定义它们


错误是什么?有消息吗?是什么阻止你将此标记为重复?你甚至可以指出这个答案中的重复答案。。。