最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
今天终于受不了再写长长的SQL语句了,写了这一段,改改可成为SQL语句生成函数
时间:2022-06-30 10:25:15 编辑:袖梨 来源:一聚教程网
<%Dim rs,sql,rsname
set rs=server.createobject("adodb.recordset")
on error resume next
sql="select * from your_table"
rs.Open sql, conn
rsname=RS( 0 ).name
for i = 1 to RS.Fields.Count - 1
'rsname=rsname&chr(9)&RS( i ).name
rsname=rsname&","&RS( i ).name
next
rsname=rsname&chr(13)
rs.close
set rs=nothing
conn.close
set conn=nothing
Function e(w)
Dim h
Dim my_array,my_array1
my_array=Split(w,",")
my_array1=Split(w,",")
Dim i
For i=0 To UBound(my_array)
my_array(i)=my_array(i)&"="&chr(39)&chr(34)&Chr(38)&my_array(i)&chr(38)&chr(34)&Chr(39)
Next
For i=0 To UBound(my_array)
my_array1(i)=chr(39)&chr(34)&Chr(38)&my_array1(i)&chr(38)&chr(34)&Chr(39)
Next
e="
"&w&"
"&"update:"&"
"&"update your_table set "& Join(my_array,",")&"where 条件"&"
"&"insert:"&"
"&"insert into your_table ("&w&")values("&Join(my_array1,",")&")"
End Function
response.write e(rsname)%>
相关文章
- 《异环》主要角色大全 06-16
- 《空之要塞:启航》赫山背景故事怎样 06-16
- 《永夜降临:复苏》伊丽莎白有哪些 06-16
- 《斗罗大陆:史莱克学院》快速升级有哪些 06-16
- 《异界事务所》装备属性强化怎样 06-16
- 《零之战线》黑豹强度表现如何 06-16