<%@言語= vbscript codepage = 936%>
<%オプションexpricit%>
<%response.buffer = true%>
<%
'/////////////////////////////////////// //////////////gestingead /////////////////////////////////// ///////////////////////////////////////////////// ////glesle /////////////////////////////////////////////// ///////////////////////////////////////////////// ///////////////////////////////////////////////// ///////////// ggig
'///
'///ファイル名:sqlbuilderforvbs
'///関数:いくつかの簡単なSQLステートメントを作成します。
'///プログラムメーカー:Zeng Siyuan
'///説明:単純なSQL文の構築「クラス」、VBSバージョン、この注釈セクションを保持している限り、それがビジネスを伴うかどうかにかかわらず、任意に使用することができます。
'///日付:2005-1-8
'/// __________________________________________________________________________________________________
'/////////////////////////////////////// //////////////gestingead /////////////////////////////////// ///////////////////////////////////////////////// ////glesle /////////////////////////////////////////////// ///////////////////////////////////////////////// ///////////////////////////////////////////////// ///////////// ggig
%>
<%
エラーの再開時に次に再開します
クラスQuestStringBuilder
プライブオブフィールズ
プライベートStrtableName
プライベートストップキー
プライベートStrpkeysort
プライベートストルコンディション
private acate()()
プライベートストロイトレーター
プライベートストロジック
プライベートブルンステート
'/-----初期化-----/
private sub class_initialize()
objfields = server.createobject(scripting.dictionary)を設定します
strtablename = null
strpkey = null
strpkeysort = null
strcondition = null
Redimimcontition(1)
stroprator = =
strlogic = and
blnstate = false
End Sub
private sub class_terminate()
objfieldsを設定=何も設定しません
strtablename = null
strpkey = null
strpkeysort = null
strcondition = null
Acontitionを消去します
stroprator = null
strlogic = null
blnstate = false
End Sub
' /----フィールド名処理----- /
プライベート機能プロセスフィールド(byval sfield)
processfield = [&sfield&]
エンド関数
' /-----フィールド値処理------ /
プライベート関数プロセスバリュー(byval svalue)
dim tmptype:tmptype = vartype(svalue)
ケースtmptypeを選択します
ケース2,3,4,5,11 'デジタルタイプ、ブールタイプ
ProcessValue = sValue
ケース8 '文字タイプ
ProcessValue = '&Safe(svalue)&'
ケース他の 'その他のタイプ
ProcessValue = '&Safe(svalue)&'
[選択]を終了します
エンド関数
' /-----包括的な治療------ /
プライベート関数プロセス(byref obj、byval strype)
薄暗いキー:キー= obj.keys
薄暗いアイテム:items = obj.items
dim intcount:intcount = obj.count
dim tmp()
RedimTMP(1)
intcount> 0の場合
dim tmparray()、i
redim tmparay(intcount-1)
I = 0からIntCount -1の場合
tmparray(i)= keys(i)&=&items(i)
次
ケースucase(trim(strtype))を選択します
ケースアップデート
Process = join(tmparray 、、)
ケース選択
Process = join(keys ,,)
ケースインサート
tmp(0)= join(keys ,,)
tmp(1)= join(items ,,)
プロセス= TMP
TMPを消去します
[選択]を終了します
tmparrayを消去します
それ以外
ケースucase(trim(strtype))を選択します
ケースアップデート
プロセス= false
ケース選択
process = *
ケースインサート
プロセス= TMP
[選択]を終了します
ifを終了します
エンド関数
' /-----小規模セキュリティ治療----- /
プライベート機能保存
SAFE =交換(s、 '、' ')
エンド関数
' /-----最後のタイムの最後の入力のパラメーターはクリアされましたが、テーブルネームを保持します------ /
public sub clear()
objfields.removeall
'strtableneame = null
strpkey = null
strpkeysort = null
strcondition = null
Acontitionを消去します
stroprator = =
strlogic = and
blnstate = false
End Sub
' /----クエリステートメントを生成---- /
パブリック関数getSelect()
dim strsqltemplate:strsqltemplate = select {fields} from {table} {条件} {orderby} {sort}
strsqltemplate = facter(strsqltemplate、{fields}、process(objfields、select))
Masspe(strtableneame)= 1の場合、機能を終了します
strsqltemplate = facter(strsqltemplate、{table}、strtableneame)
masspe(strcondition)<> 1およびstrcondition <> thenの場合
strsqltemplate = epplace(strsqltem