<%@Sprache = vbscript Codepage = 936%>
< % Option explizit %>
< % Response.buffer = true %>
<%
'///////////////////////////////////////////////// ////////////////////////////////////// ./////////////. ////////////////////////////////////////////////// ////// GLESLE /////////////////////////////////////////. ////////////////////////////////////////////////// ////////////////////////////////////////////////// /////////////////////////////////////////////////////. ///////////////////////// GESTLENE AS /////////////////////////. /////////////////////// Gons
'////
'/// Dateiname: SQLBuilderForVBs
'/// Funktion: Erstellen Sie einige einfache SQL -Anweisungen.
'/// Programmaker: Zeng Siyuan
'/// Beschreibung: Einfache SQL -Satzkonstruktion "Klasse", VBS -Version, solange Sie diesen Annotationsabschnitt beibehalten, unabhängig davon
'/// Datum: 2005-1-8
'/// _________________________________________________________________________________________
'///////////////////////////////////////////////// ////////////////////////////////////// ./////////////. ////////////////////////////////////////////////// ////// GLESLE /////////////////////////////////////////. ////////////////////////////////////////////////// ////////////////////////////////////////////////// /////////////////////////////////////////////////////. ///////////////////////// GESTLENE AS /////////////////////////. /////////////////////// Gons
%>
<%
Bei der nächsten Fehleraufnahme als nächstes
Klasse QuestStringBuilder
Prive Objfields
Privater StrtableName
Privates Strpkey
Private Strpkeysort
Private Strkondition
Privater acate () ()
Privates Stroperator
Privates Strlogic
Privates Blnstate
'/-----Initialisierung-----/
Private sub class_initialize ()
Setzen Sie objfields = server.createObject (scripting.Dictionary)
StrtableName = null
Strpkey = null
Strpkeysort = null
StrCondition = NULL
Redim Acontition (1)
Stroprator = =
Strlogic = und
BLNSTATE = false
Ende sub
Private sub class_terate ()
Setzen Sie Objfields = nichts
StrtableName = null
Strpkey = null
Strpkeysort = null
StrCondition = NULL
Akontition löschen
Stroprator = NULL
strlogic = null
BLNSTATE = false
Ende sub
' /---- Feldname Verarbeitung ----- / /
Private Funktion Processfield (Byval Sfield)
Processfield = [& sfield &]
Endfunktion
' /----- Feldwertverarbeitung ------ /
Privates Funktionsprozesswert (Byval SValue)
Dim tmptype: tmptype = vartype (SValue)
Wählen Sie Fall tmptype
Fall 2,3,4,5,11 'digitaler Typ, Boolesche Typ
ProcessValue = sValue
Fall 8 'Zeichentyp
ProcessValue = '& sicher (SValue) &'
Fall sonst andere Typen
ProcessValue = '& sicher (SValue) &'
Ende auswählen
Endfunktion
' /----- umfassende Behandlung ------ /
Privater Funktionsprozess (ByRef OBJ, Byval Strtype)
Dunkeln Tasten: Keys = Obj.keys
schwache Elemente: Elemente = Obj.Items
Dim intCount: intCount = obj.count
dim TMP ()
REDIM TMP (1)
Wenn intCount> 0 dann
dim tmparray (), ich
Redim tmparay (intCount-1)
für i = 0 bis intCount -1
tmparray (i) = keys (i) & = & items (i)
nächste
Wählen Sie Case uCase (Trim (STRTTYPE))
Fall -Update
Process = join (tmparray ,,)
Fallauswahl
Process = join (keys ,,)
Falleinsatz
Tmp (0) = join (Schlüssel ,,)
Tmp (1) = join (items ,,)
Process = tmp
TMP löschen
Ende auswählen
Tmparray löschen
anders
Wählen Sie Case uCase (Trim (STRTTYPE))
Fall -Update
Process = false
Fallauswahl
Prozess = *
Falleinsatz
Process = tmp
Ende auswählen
Ende wenn
Endfunktion
' /----- kleine Sicherheitsbehandlung ----- / /
Private Funktionsparen (en)
sicher = Ersetzen (s, ',' ')
Endfunktion
' /-----
Öffentlicher Sub Clear ()
objfields.removeall
'StrtableAME = NULL
Strpkey = null
Strpkeysort = null
StrCondition = NULL
Akontition löschen
Stroprator = =
Strlogic = und
BLNSTATE = false
Ende sub
' /---- Erzeugen Sie Abfrageanweisungen ---- /
Öffentliche Funktion getSelect ()
Dim strsqltemplate: strsqltemplate = select {fields} aus {table} {Bedingungen} {orderby} {sort}
Strsqltemplate = ersetzen (strsqltemplate, {fields}, prozess (objfields, select))
Wenn Masspe (StrtableNeame) = 1, beenden Sie die Funktion
Strsqltemplate = ersetzen (strsqltemplate, {table}, strtableneAme)
Wenn Masspe (Strcondition) <> 1 und Strcondition <> dann <>
STRSQLTEMPLET = STRSQLTEM