|
请教各位高手,以下代码是有关SQL SERVER 2005数据库连接,但具体使用我不是很明白.比如,我有一个远程网站,数据库是放在远程网站上,怎样连接才能访问到数据库呢?如果数据库是在自己的电脑上,又怎样连接在网络中可以访问到呢?
<%
Set conn = CreateObject("ADODB.Connection")
Dim strConn
strConn = "Provider=SQLNCLI;Server=localhost;Database=YourData;Uid=sa;Pwd=******;"
conn.Open strConn
%>
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes; |
|