ADO CreateParameter 方法

来源:互联网 发布:淘宝代销发货地址 编辑:程序博客网 时间:2024/05/22 14:06
 

The CreateParameter method creates and returns a Parameter object containing the specified properties like name, type, direction, size, and value.
CreateParameter的作用是:创建或返回一个新的参数对象,它可以是类似于名称、类型、尺寸大小和值这样的属性。

Note: This method does not automatically add the new Parameter to the collection. To add the Parameter to the Parameters Collection, use the Append property.
注意:这个方法不会将新参数添加到集合中。如果你要实现上述功能,可以使用Append属性。

Syntax
语法

Set objparameter=objcommand.CreateParameter(name,type,direction,size,value)

Parameter
参数 Description
描述 name Optional. The name of the Parameter object.
可选参数。指定参数对象的名称 type Optional. One of the DataTypeEnum contatants that specifies the data type for the Parameter object. Default is adEmpty. If you choose a variable-length data type, you will also need to specify the Size parameter or the Size property. If you specify adDecimal or adNumeric data type, you must also set the NumericScale and the Precision properties of the Parameter object.
 可选参数。可设置为DataTypeEnum常量集内的其中一个常量,以指名参数对象的数据类型。默认值是:adEmpty。如果你选择variable-length[变量-长度]数据类型,你必须还要指定Size参数和Size属性。如果你指定了adDecimal或adNumeric数据类型,你还必须要设置NumericScale[数值尺寸]以及参数对象中的Precision[精密度]属性 direction Optional. One of the ParameterDirectionEnum constants that defines the direction of the Parameter object. Default is adParamInput.
可选参数。可设置为ParameterDirectionEnum常量集内的一个常量,以定义参数对象的direction[方向]。默认值为adParamInput size Optional. Specifies the length of a variable-length data type, if such a type was declared in the Type parameter. Default is zero.
可选参数。指定一个variable-length[变量-长度]数据类型,如果你在Type参数中声明了改类型的话。默认值为0 value Optional. The value of the Parameter object
可选参数。指定参数对象的值

DataTypeEnum Values

Specifies the data type of a Field, Parameter, or Property object
指定一个字段、参数或属性对象的数据类型:

Constant
常量 Value
值 Description
描述 adEmpty 0 No value
空值 adSmallInt 2 A 2-byte signed integer.
一个2位含正负号的整数 adInteger 3 A 4-byte signed integer.
一个4位含正负号的整数 adSingle 4 A single-precision floating-point value.
一个单精度浮点值 adDouble 5 A double-precision floating-point value.
一个双精度浮点值 adCurrency 6 A currency value
一个货币值 adDate 7 The number of days since December 30, 1899 + the fraction of a day.
日期值 adBSTR 8 A null-terminated character string.
一个null-terminated[不含后缀]的字符/字符串 adIDispatch 9 A pointer to an IDispatch interface on a COM object. Note: Currently not supported by ADO.
IDispatch(位于COM对象)界面指示器。
注意:现在还不被ADO支持 adError 10 A 32-bit error code
一个32位的错误代码 adBoolean 11 A boolean value.
一个逻辑值 adVariant 12 An Automation Variant. Note: Currently not supported by ADO.
一个自动操作的变量
注意:现在还不被ADO支持 adIUnknown 13 A pointer to an IUnknown interface on a COM object. Note: Currently not supported by ADO.
IUnknown(位于COM对象)界面指示器。
注意:现在还不被ADO支持 adDecimal 14 An exact numeric value with a fixed precision and scale.
拥有一个固定精确度和范围的一个精确数值 adTinyInt 16 A 1-byte signed integer.
一个1位含正负号的整数 adUnsignedTinyInt 17 A 1-byte unsigned integer.
一个1位不含正负号的整数 adUnsignedSmallInt 18 A 2-byte unsigned integer.
一个2位不含正负号的整数 adUnsignedInt 19 A 4-byte unsigned integer.
一个4位不含正负号的整数 adBigInt 20 An 8-byte signed integer.
一个8位含正负号的整数 adUnsignedBigInt 21 An 8-byte unsigned integer.
一个8位不含正负号的整数 adFileTime 64 The number of 100-nanosecond intervals since January 1,1601
从1601年1月1日开始计算的以100毫微秒为单位所经过的数量(即经过了多少个100毫微秒) adGUID 72 A globally unique identifier (GUID)
全局统一标识符(GUID) adBinary 128 A binary value.
一个二进制值 adChar 129 A string value.
一个字符串值 adWChar 130 A null-terminated Unicode character string.
一个null-terminated(不含后缀)的Unicode[统一的字符编码标准, 采用双字节对字符进行编码]字符/字符串 adNumeric 131 An exact numeric value with a fixed precision and scale.
拥有一个固定精确度和范围的一个精确数值 adUserDefined 132 A user-defined variable.
用户自定义变量 adDBDate 133 A date value (yyyymmdd).
日期值(yyyymmdd) adDBTime 134 A time value (hhmmss).
时间值(hhmmss) adDBTimeStamp 135 A date/time stamp (yyyymmddhhmmss plus a fraction in billionths).
一个日期/时间戳(yyyymmddhhmmss加上一个十一分之一的小数) adChapter 136 A 4-byte chapter value that identifies rows in a child rowset
一个4位的chapter值,它指明了字记录集 adPropVariant 138 An Automation PROPVARIANT.
一个自动操作执行的PROPVARIANT adVarNumeric 139 A numeric value (Parameter object only).
一个数值(仅支持参数[parameter]对象) adVarChar 200 A string value (Parameter object only).
一个字符串值(仅支持参数[parameter]对象) adLongVarChar 201 A long string value.
一个长字符串值 adVarWChar 202 A null-terminated Unicode character string.
一个null-terminated(不含后缀)的Unicode[统一的字符编码标准, 采用双字节对字符进行编码]字符/字符串 adLongVarWChar 203 A long null-terminated Unicode string value.
一个null-terminated(不含后缀)的Unicode[统一的字符编码标准, 采用双字节对字符进行编码] 长字符/字符串 adVarBinary 204 A binary value (Parameter object only).
一个二进制值(仅支持参数[parameter]对象) adLongVarBinary 205 A long binary value.
一个长二进制值(仅支持参数[parameter]对象) AdArray 0x2000 A flag value combined with another data type constant. Indicates an array of that other data type.
一个标记值,它是与其他的数据类型常数结合在一起使用的。它指明了包含其它数据类型的数组

ParameterDirectionEnum Values

Specifies whether the Parameter represents an input parameter, an output parameter, both an input and an output parameter, or the return value from a stored procedure.
指定参数是否代表了一个输入参数、一个输出参数或者同时代表了上述二者,或返回已有的程序值。

Constant
常量 Value
值 Description
描述 adParamUnknown 0 Direction is unknown
未知指示(说明) adParamInput 1 Input parameter
输入参数 adParamOutput 2 Output parameter
输出参数 adParamInputOutput 3 Both input and output parameter
同时包含输入参数和输出参数 adParamReturnValue 4 Return value
返回值
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 夏普电视遥控器失灵怎么办 西门子冰箱噪音大怎么办 高原饭煮不熟怎么办 电饭煲内胆坏了怎么办 电饭煲胶圈掉了怎么办 调温耦合器坏了怎么办 电饭煲主板坏了怎么办 meidea电饭煲出现c1怎么办 冰箱密封条长了怎么办 冰箱冷冻门变形怎么办 海尔冰箱冷藏室结冰怎么办 西门子冰箱冷藏室结冰怎么办 冰箱老是有霜冻 怎么办 冰箱里很多霜冻怎么办? 冰箱里有霜冻怎么办 冰柜冰堵了怎么办 冰箱总是冰堵怎么办 冰箱保鲜门关紧怎么办 冰箱门不能关了 怎么办 冰箱门开了一天怎么办 购物卡到期了怎么办 装修尾款不给怎么办 空调吹的风不凉怎么办 华林购物卡怎么办 京东e卡刷単被骗怎么办 苏宁信用卡退款怎么办 家里暖气不热怎么办 苏宁退货不成功怎么办 任性付冻结了怎么办 任性贷风险提示怎么办 保修发票没了怎么办 家电发票丢了怎么办 天猫苏宁发票丢了怎么办 本子密码忘记了怎么办 直属领导抢客户怎么办 老板油烟机坏了怎么办 闲鱼上买洗衣机自提怎么办 水龙头水流太小怎么办 水龙头压力太小怎么办 浴室水龙头水小怎么办 冰箱出水口堵了怎么办