SQL Server ODBC连接字符串
标准连接(Standard Security)
Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;
当服务器为本地时Server可以使用(local)
Driver={SQL Server};Server=(local);Database=pubs;Uid=sa;Pwd=asdasd;
当连接远程服务器时,需指定地址、端口号和网络库
Driver={SQL Server};Server=130.120.110.001;Address=130.120.110.001,1052;Network=dbmssocn; Database=pubs;Uid=sa;Pwd=asdasd;
信任连接(Trusted connection): (Microsoft Windows NT 集成了安全性)
Driver={SQL Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;
或者
Driver={SQL Server};Server=Aron1;Database=pubs; Uid=;Pwd=;
连接时弹出输入用户名和口令对话框
Conn.Properties("Prompt") = adPromptAlways
Conn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;"