<%
'****************************************
'*  文件：db.asp
'*  函数：GetSQLServerConnection()
'*  功能：实现Sql数据库连接参数
'****************************************
Function GetSQLServerConnection( Computer, UserID, Password, Db )
   Dim Params, conn

   Set GetSQLServerConnection = Nothing
'  使用SQLOLEDB驱动程序进行数据库连接，添加数据源(服务器)
   Params = "Provider=SQLOLEDB.1"               
   Params = Params & ";Data Source=" & Computer

'  添加用户名、密码、数据库
   Params = Params & ";User ID=" & UserID
   Params = Params & ";Password=" & Password
   Params = Params & ";Initial Catalog=" & Db

'  创建服务器连接对象，并打开连接参数
   Set conn = Server.CreateObject("ADODB.Connection")
   conn.Open Params
   Set GetSQLServerConnection = conn
End Function
%>

