<%@Language = vbscript codepage = 936%>
< % Opsi eksplisit %>
< % Response.buffer = true %>
<%
'///////////////////////////////////////////////// ////////////////////Gestingead ///////////////////////////// ////////////////////////////////////////////////// /////Glesle //////////////////////////////////////////// ////////////////////////////////////////////////// ////////////////////////////////////////////////// ///////////////Ggestle as///////////////////////////////// /////////////////////ggestlene as/////////////////////////// ///////////////////// Gons
'///
'/// Nama file: sqlbuilderforvbs
'/// Fungsi: Bangun beberapa pernyataan SQL sederhana.
'/// Programmaker: Zeng Siyuan
'/// Deskripsi: Konstruksi Kalimat SQL Sederhana Konstruksi "Kelas", Versi VBS, Selama Anda menjaga bagian anotasi ini, apakah itu melibatkan bisnis atau tidak, Anda dapat menggunakannya secara sewenang -wenang, cetak ulang atau kutip
'/// Tanggal: 2005-1-8
'/// _____________________________________________________________________________________
'///////////////////////////////////////////////// ////////////////////Gestingead ///////////////////////////// ////////////////////////////////////////////////// /////Glesle //////////////////////////////////////////// ////////////////////////////////////////////////// ////////////////////////////////////////////////// ///////////////Ggestle as///////////////////////////////// /////////////////////ggestlene as/////////////////////////// ///////////////////// Gons
%>
<%
Pada kesalahan resume berikutnya
Kelas QuestStringBuilder
Prive objfields
Private StrtableName
STRPKEY pribadi
STRPKEYSORT Pribadi
Strcondition pribadi
Private Acate () ()
Stroperator pribadi
STRLOGIC PRIBADI
Blnstate pribadi
'/----- Inisialisasi -----/
Private sub class_initialize ()
Set ObjFields = Server.CreateObject (Scripting.Dictionary)
strtablename = null
strpkey = null
strpkeysort = null
Strcondition = null
Redim Acontition (1)
Stroprator = =
strlogic = dan
blnstate = false
akhir sub
Private Sub Class_Terminate ()
atur objFields = tidak ada
strtablename = null
strpkey = null
strpkeysort = null
Strcondition = null
Hapus Ason
Stroprator = null
strlogic = null
blnstate = false
akhir sub
' /---- Pemrosesan Nama Lapangan ----- /
Fungsi Privat Processfield (Byval Sfield)
Processfield = [& Sfield &]
fungsi akhir
' /----- Pemrosesan Nilai Bidang ------ /
Process Function ProcessValue (BYVAL SVALUE)
DIMPTYPE: TMPTYPE = VARTYPE (SVALUE)
Pilih tmptype case
Kasing 2,3,4,5,11 'Jenis Digital, Jenis Boolean
ProcessValue = SValue
Jenis Karakter Kasus 8 '
ProcessValue = '& Safe (SValue) &'
Kasus lain 'jenis lain
ProcessValue = '& Safe (SValue) &'
Akhiri Pilih
fungsi akhir
' /----- Perawatan Komprehensif ------ /
Proses Fungsi Pribadi (Byref Obj, Byval Strtype)
Tombol redup: tombol = obj.keys
item redup: item = obj.items
DIM INTCOUNT: intcount = obj.count
redup tmp ()
Redim tmp (1)
Jika IntCount> 0 lalu
redup tmparray (), i
Redim tmParay (intcount-1)
untuk i = 0 ke intcount -1
tmpArray (i) = tombol (i) & = & item (i)
Berikutnya
Pilih case ucase (trim (strtype))
Pembaruan Kasus
Proses = Bergabunglah (tmparray ,,)
Kasus Pilih
Proses = Bergabunglah (tombol ,,)
sisipan kasing
Tmp (0) = gabungkan (tombol ,,)
TMP (1) = bergabung (item ,,)
Proses = TMP
Hapus TMP
Akhiri Pilih
Hapus tmparray
kalau tidak
Pilih case ucase (trim (strtype))
Pembaruan Kasus
Proses = false
Kasus Pilih
Proses = *
sisipan kasing
Proses = TMP
Akhiri Pilih
akhiri jika
fungsi akhir
' /----- Perlakuan Keamanan Kecil ----- /
Penghematan fungsi pribadi
safe = ganti (s, ',' ')
fungsi akhir
' /----- Parameter input sebelumnya, tetapi mempertahankan nama meja ------
Sub Clear Publik ()
objfields.removeall
'Strtableneame = null
strpkey = null
strpkeysort = null
Strcondition = null
Hapus Ason
Stroprator = =
strlogic = dan
blnstate = false
akhir sub
' /---- menghasilkan pernyataan kueri ---- / /
Fungsi publik getSelect ()
Dim strsqlTemplate: strsqltemplate = select {fields} dari {table} {conditions} {orderby} {sort}
Strsqltemplate = ganti (strsqltemplate, {fields}, proses (objFields, select)))
Jika masspe (strtableneame) = 1 maka fungsi keluar
Strsqltemplate = ganti (strsqltemplate, {tabel}, strtableneame)
Jika Masspe (Strcondition) <> 1 dan Strcondition <>
strsqltemplate = ganti (strsqltem