日期:2014-05-18  浏览次数:20535 次

不通过dsn访问sqlserver
在连接字符串里加上服务器和数据库驱动程序就可以了
Example:
dim   conn
set   conn   =   Server.CreateObject( "ADODB.Connection ")
conn.ConnectionString   =   "driver={SQL   Server}; "server=yourserver;uid=sa;pwd=pwd;database=pubs "
conn.open
Set   cmd=   Server.CreateObject( "ADODB.Command ")  
Set   cmd.ActiveConnection   =   conn    


转http://www.chinaitpower.com/A/2001-11-09/4301.html

------解决方案--------------------
DRIVER={SQL SERVER};SERVER=服务器名或IP;DATABASE=数据库名;UID=用户名;PWD=密码
------解决方案--------------------
???
------解决方案--------------------
dim conn
set conn = Server.CreateObject( "ADODB.Connection ")
conn.ConnectionString = "DRIVER={SQL SERVER};SERVER=服务器名或IP;DATABASE=数据库名;UID=用户名;PWD=密码 "
conn.open
Set cmd= Server.CreateObject( "ADODB.Command ")
Set cmd.ActiveConnection = conn