当前位置:编程学习 > asp >>

asp+access sql insert into select表复制

这里是把一个同的数据一次性保存到另一个表,用的是sql insert into  select另一张同结构的新表

sub append()
call opendb()
dim zsql,zdysql
zsql="insert into zdgz select title,s_name,user_from,image,content,send_date,isture from zdy "
 conn.execute(zsql)
 if err=0 then
  response.write("<br><hr>")
 response.write("<font  class=style1 >Data successful merger</font><hr><br>")
 conn.execute("delete * from zdy")
 else
  response.write("<br><hr><br>")
 response.write("<font  class=style1>If you are repeatedly running a home, data merge successfully.If you are running the first page, the data failed merger.</font><hr><br><br><br><br><br><br><p></p>")
 end if
end sub

数据连接代码

sub opendb()
set rs=server.CreateObject("adodb.recordset")
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="provider=microsoft.jet.oledb.4.0; data source="&server.mappath("datasource/hhinfo.mdb")
conn.open
end sub

本站原创转载注明 www.zzzyk.com

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,