|
<%
set conn1=server.createobject("adodb.connection")
strConn1 = "Provider=Sqloledb;User ID=sa;Password=123;Initial Catalog=web;Data Source=(local)"
Conn1.open strConn1
set conn2=server.createobject("adodb.connection")
strConn2 = "Provider=Sqloledb;User ID=sa;Password=123;Initial Catalog=web;Data Source=192.168.0.1"
Conn2.open strConn2
set rs1=server.createobject("adodb.recordset")
rs1.open "Select * From 表1",Conn1,0,1
do while not rs1.eof
t1=rs1("name")
set rs2=server.createobject("adodb.recordset")
rs2.Open "Select * from 表2 where name='"&t1&"'",Conn2,1,1
if Not rs2.eof then
conn1.Execute("delete 表1 where name='"&t1&"'")
end if
rs1.MoveNext
loop
rs1.close
set rs1=nothing
%> |
|