CreateParameter (Command オブジェクト)

object.CreateParameter ([name], [type], [direction], [size], [value])

引数

object
Command オブジェクトの名前を指定します。
name
パラメータ名
type
Parameterオブジェクトのデータ型
定数内容
adBinary128バイナリ型
adBoolean11ブール型
adChar129文字列方
adCurrency6通貨型
adDate7日付型
adDecimal14バリアント10進型
adInteger34バイト符号付き整数型
adVariant12バリアント型
direction
パラメータの入出力方向
定数内容
adParamUnKnown0パラメータ方向不明
adParamInput1入力パラメータ(デフォルト)
adParamOutput2出力パラメータ
adParamInputOutput3入出力パラメータ
adParamReturnValue4戻り値
size
パラメータの最大サイズ
value
パラメータの値

解説

パラメータを作成します。
パラメータの名前、種類、入出力の方向、サイズ、値を指定し、Parameterオブジェクトを作成します。

使用例

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "sample"

Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = objConn
objCmd.CommandText = "QueryName"

Set objara = objCmd.Createarameter("ID",3,1,,9999)



関連項目

ActiveConnectionCommandオブジェクトが属する接続名を設定します。
CommandTextSQL文、テーブル名、ストアドプロシジャ名を設定します。
CommandTimeoutコマンドのタイムアウト時間(秒)を設定します。
CommandType実行するコマンドの種類を設定します。
Dialectコマンド文字列またはストリームウを表すGUIDを返します。
Nameコマンド名を設定します。
Preparedコマンドをコンパイルして保存するかどうかを設定します。
StateCommandオブジェクトの状態を返します。
CancelExecute メソッドで非同期実行したコマンドをキャンセルします。
ExecuteCommandText プロパティで指定されたコマンドを実行し、Recordsetを返します。


ASPリファレンス

データアクセスオブジェクト




ASP組み込みオブジェクト


ファイル操作オブジェクト


Copyright (C) ASP@Workshop All rights reserved.