ASP连接数据库SQLServer

Set conn=Server.CreateObject("adodb.connection")
Set conn1=Server.CreateObject("adodb.connection")
Set rs=Server.CreateObject("adodb.Recordset")
Set cmd=Server.CreateObject("adodb.Command")

db_host="127.0.0.1"
db_name="mazey_name"
db_user="mazey_user"
db_pass="mazey_password"

constr="provider=sqloledb;initial catalog=" & db_name
constr=constr & "; data source=" & db_host
constr=constr & ";user id=" & db_user
constr=constr & ";password=" & db_pass

conn.connectionstring=constr
conn1.connectionstring=constr

发表评论

您的电子邮箱地址不会被公开。