大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> 今天终于受不了再写长长的SQL语句了,写了这一段,改改可成为SQL语句生成函数

今天终于受不了再写长长的SQL语句了,写了这一段,改改可成为SQL语句生成函数

时间: 2021-07-31 作者:daque

<!--#include file="conn.asp" --><html><head><title>untitled document</title><meta http-equiv="content-type" content="text/html; charset=utf8"></head><body><%dim rs,sql,rsnameset rs=server.createobject("adodb.recordset") on error resume next sql="select * from your_table"rs.open sql, connrsname=rs( 0 ).namefor i = 1 to rs.fields.count - 1 'rsname=rsname&chr(9)&rs( i ).namersname=rsname&","&rs( i ).namenext rsname=rsname&chr(13)rs.closeset rs=nothingconn.closeset conn=nothingfunction e(w)dim hdim my_array,my_array1my_array=split(w,",")my_array1=split(w,",")dim ifor 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)nextfor i=0 to ubound(my_array)my_array1(i)=chr(39)&chr(34)&chr(38)&my_array1(i)&chr(38)&chr(34)&chr(39)nexte="<p>"&w&"<p>"&"update:"&"<br>"&"update your_table set "& join(my_array,",")&"where 前提"&"<p>"&"insert:"&"<br>"&"insert into your_table ("&w&")values("&join(my_array1,",")&")"end functionresponse.write e(rsname)%></body></html>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.