日期:2012-07-05  浏览次数:20889 次

<!--#include file="conn.asp" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%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="<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 Function
response.write e(rsname)%>
</body>
</html>