当前位置:网络资源中心文章中心数据库类Mysql → 文章内容

不通过dsn访问sql server

减小字体 增大字体 作者:我不懂  来源:站长资源  发布时间:2008-5-23 14:48:01
在连接字符串里加上服务器和数据库驱动程序就可以了
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