一个连接多个sql数据库的例子
<%
'On Error Resume Next
set conn_old = server.createobject("adodb.Connection")
connStr_old = "PROVIDER=SQLOLEDB;DATA SOURCE=202.111.184.119;UID=sa;PWD=123456;DATABASE=dataBase"
conn_old.open connStr_old
'新数据,被修改
set conn_new = server.createobject("adodb.Connection")
connStr_old = "PROVIDER=SQLOLEDB;DATA SOURCE=202.111.184.119;UID=sa;PWD=123456;DATABASE=dataBase1"
conn_new.open connStr_new
i_sql_old = "select * from b_people"
set i_rs_old = server.CreateObject("adodb.recordset")
i_rs_old.open i_sql_old,conn_old,1,1
do while not i_rs_old.eof
i_sql_update_new = "update b_people set addTime = '"&i_rs_old("addTime")&"' where id="&i_rs_old("id")
response.write i_sql_update_new
conn_new.execute i_sql_update_new
i_rs_old.movenext
loop
i_rs_old.close
set i_rs_old = nothing
response.write "修改成功sd!"
%>
先分别写上你要连接的数据的连接对象,
再在使用时分别调用需使用的数据库连接对象。。。
看实际操作。想练几个就连几个