当前位置:帮助 >> 高级教程

ASP 连接 MSSQL的方法

发布日期:2017/9/26 9:49:59 访问次数:163

mssql_datahost = "127.0.0.1" '数据库地址

mssql_dataname = "dataname" '数据库名称

mssql_username = "sa" '数据库用户名

mssql_password = "123" '数据库密码

connstr = "Provider = Sqloledb; User ID = "&mssql_username&"; Password = "&mssql_password&"; Initial Catalog = "&mssql_dataname&"; Data Source = "&mssql_datahost&";"

Set conn = Server.CreateObject("ADODB.CONNECTION")

conn.Open connstr

13400472755