<!--#include file="include/conn.asp"-->
<%
sql = "select * from ghs" '选择需要导出的表
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,3,3
%>
<%
set Conn1 = Server.CreateObject("ADODB.Connection")
param = "driver={Microsoft Access Driver (*.mdb)}"
conn1.Open param & ";dbq=" & Server.MapPath("date/dd.mdb") '导出到ACCESS的位置,该数据库要事先建好字段
conn1.execute("delete from ghs") '先删除表里原有的数据(cck5.com)
%>
<%
do while not rs.eof
%>
<%
mc=rs("mc")
dz=rs("dz")
lxr=rs("lxr")
phone=rs("phone")
xkzh=rs("xkzh")
zzh=rs("zzh")
swdjh=rs("swdjh")
spmc=rs("spmc")
xkzsc=rs("xkzsc")
addriqi=rs("addriqi")
yonghu=rs("yonghu")
mcpy=rs("mcpy")
mcpy2=rs("mcpy2")
%>
<%
sql1="insert into ghs(mc,dz,lxr,phone,xkzh,zzh,swdjh,spmc,xkzsc,addriqi,yonghu,mcpy,mcpy2) values('"& mc &"','"&dz&"','"&lxr&"','"&phone&"','"&xkzh&"','"&zzh&"','"&swdjh&"','"&spmc&"','"&xkzsc&"','"&addriqi&"','"&yonghu&"','"&mcpy&"','"&mcpy2&"')"
conn1.execute (sql1) '导出
%>
<%
rs.movenext
loop
conn1.close
%>
<%
response.redirect "date/dd.mdb"
%>