Method One:
<%
Dim conn
Set Conn=server.createobject ("Adodb.connection")
Conn.Open "Provider=sqloledb;data source=db.janusgroup.cn; uid=web286418; PWD=J2Z0H1V2;DATABASE=WWW_JANUSGROUP_CN "
Set conn = Server.CreateObject ("ADODB. Connection ")
dsntemp= "Driver={sql Server}; server=db.janusgroup.cn; uid=web286418; PWD=J2Z0H1V2;DATABASE=WWW_JANUSGROUP_CN "
Conn.Open Dsntemp
%>
Method Two:
<%
Option Explicit
Dim startime
Dim conn
Dim connstr
Dim Db,pass_word,user_id,data_source
Startime=timer ()
db= "WWW_DB_CN" database name
pass_word= "0h1v2" ' password= account password
User_id= "Web2-sql8" ' User id= login account
Data_source= "100.100.100.100" ' Data source= service name or IP
Set conn = Server.CreateObject ("ADODB. Connection ")
Connstr= "Provider=SQLOLEDB.1; Password= ' "&pass_word&"; Persist Security info=true; User id= ' &User_ID& '; Initial catalog= ' &db& ' ';D ata source= ' &Data_Source& ' '
Conn. Open ConnStr
function Closedb
Conn.close
Set conn = Nothing
End Function
%>