|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
减少客户内IT专业人才缺乏带来的影响。ASP的客户员工利用浏览器进入相关的应用软件,简单易用,无需专业技术支持。字符串〈%
classSQLString
************************************
变量界说
************************************
sTableName----表名
iSQLType----SQL语句范例:0-增添,1-更新,2-删除,3-查询
sWhere----前提
sOrder----排序体例
sSQL----值
PrivatesTableName,iSQLType,sWhere,sOrder,sSQL
************************************
类初始化/停止
************************************
PrivateSubClass_Initialize()
sTableName=""
iSQLType=0
sWhere=""
sOrder=""
sSQL=""
EndSub
PrivateSubClass_Terminate()
EndSub
************************************
属性
************************************
设置表名的属性
PublicPropertyLetTableName(value)
sTableName=value
EndProperty
设置前提
PublicPropertyLetWhere(value)
sWhere=value
EndProperty
设置排序体例
PublicPropertyLetOrder(value)
sOrder=value
EndProperty
设置查询语句的范例
PublicpropertyLetSQLType(value)
iSQLType=value
selectcaseiSQLType
case0
sSQL="insertinto{&*#}0({&*#}1)values({&*#}2)"
case1
sSQL="update{&*#}0set{&*#}1={&*#}2"
case2
sSQL="deletefrom{&*#}0"
case3
sSQL="select{&*#}1from{&*#}0"
endselect
EndProperty
************************************
函数
************************************
增添字段(字段称号,字段值)
PublicSubAddField(sFieldName,sValue)
selectcaseiSQLType
case0
sSQL=replace(sSQL,"{&*#}1",sFieldName&",{&*#}1")
sSQL=replace(sSQL,"{&*#}2",""&sValue&",{&*#}2")
case1
sSQL=replace(sSQL,"{&*#}1",sFieldName)
sSQL=replace(sSQL,"{&*#}2",""&sValue&",{&*#}1={&*#}2")
case3
sSQL=replace(sSQL,"{&*#}1",sFieldName&",{&*#}1")
EndSelect
EndSub
修正的前往字符串值的函数
前往SQL语句
PublicFunctionReturnSQL()
sSQL=replace(sSQL,"{&*#}0",sTableName)
selectcaseiSQLType
case0
sSQL=replace(sSQL,",{&*#}1","")
sSQL=replace(sSQL,",{&*#}2","")
case1
sSQL=replace(sSQL,",{&*#}1={&*#}2","")
case3
sSQL=replace(sSQL,",{&*#}1","")
endSelect
ifsWhere""andiSQLType0then
sSQL=sSQL&"where"&sWhere
endif
ifsOrder""andiSQLType0then
sSQL=sSQL&"orderby"&sOrder
endif
ReturnSQL=sSQL
EndFunction
前往SQL语句
PublicFunctionReturnSQL1()
sSQL=replace(sSQL,"{&*#}0",sTableName)
selectcaseiSQLType
case0
sSQL=replace(sSQL,",{&*#}1","")
sSQL=replace(sSQL,",{&*#}2","")
case1
sSQL=replace(sSQL,",{&*#}1={&*#}2","")
case3
sSQL=replace(sSQL,",{&*#}1","")
endSelect
ifsWhere""andiSQLType0then
sSQL=sSQL&"where"&sWhere
endif
ifsOrder""andiSQLType0then
sSQL=sSQL&"orderby"&sOrder
endif
ReturnSQL=sSQL
EndFunction
清空语句
PublicSubClear()
sTableName=""
iSQLType=0
sWhere=""
sOrder=""
sSQL=""
EndSub
Endclass
%〉
</p>只要你想学,就没什么优缺点,上面那位大哥已经把网上的评论说了,但我认为想学哪个都一样,不然它就不可能在当今时代数字艺术方面存活到今天 |
|