ASP中ACCESS数据库转成SQL SERVER的链接代码怎么改? 5
<%'打开数据库连接dimconn,connstr,db,rsdb="manage/db/db.mdf"Setconn=Server.CreateObject("ADOD...
<%
'打开数据库连接
dim conn,connstr,db,rs
db="manage/db/db.mdf"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="driver={sql server};server=(local).;uid=sa;pwd=;database=db"
conn.Open connstr
%> 展开
'打开数据库连接
dim conn,connstr,db,rs
db="manage/db/db.mdf"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="driver={sql server};server=(local).;uid=sa;pwd=;database=db"
conn.Open connstr
%> 展开
展开全部
dim db
dim sqldatabasename,sqlpassword,sqlusername,sqlhostip
const bjxshopversion=2
const bjxshopdatabasetype="access"
db="access数据路径(根目录为基准)" 'manage/db/db.mdf 这是你的数据库 如果manage在根目录下的话改为/manage/db/db.mdf
sqlusername = "bjxshop" '用户名如:sa
sqlpassword = "bjxshop888" '密码
sqldatabasename = "bjxshop" '数据库名称
sqlhostip = "127.0.0.1" '数据库ip
on error resume next
dim connstr
dim conn,rs,errmsg,iserr
if bjxshopdatabasetype="sql" then
'这是sql server连接字符串
connstr = "provider = sqloledb; user id = " & sqlusername & "; password = " & sqlpassword & "; initial catalog = " & sqldatabasename & "; data source = " & sqlhostip & ";"
else
'这是access数据库的
connstr = "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(db)
end if
set conn = server.createobject("adodb.connection")
conn.open connstr
asp常用数据库连接字符串,access和sql server
dim sqldatabasename,sqlpassword,sqlusername,sqlhostip
const bjxshopversion=2
const bjxshopdatabasetype="access"
db="access数据路径(根目录为基准)" 'manage/db/db.mdf 这是你的数据库 如果manage在根目录下的话改为/manage/db/db.mdf
sqlusername = "bjxshop" '用户名如:sa
sqlpassword = "bjxshop888" '密码
sqldatabasename = "bjxshop" '数据库名称
sqlhostip = "127.0.0.1" '数据库ip
on error resume next
dim connstr
dim conn,rs,errmsg,iserr
if bjxshopdatabasetype="sql" then
'这是sql server连接字符串
connstr = "provider = sqloledb; user id = " & sqlusername & "; password = " & sqlpassword & "; initial catalog = " & sqldatabasename & "; data source = " & sqlhostip & ";"
else
'这是access数据库的
connstr = "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(db)
end if
set conn = server.createobject("adodb.connection")
conn.open connstr
asp常用数据库连接字符串,access和sql server
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim conn,connstr
Set conn = Server.CreateObject("ADODB.Connection")
conn.Connstr="driver={SQL Server};server=(local);uid=sa;pwd=sa;database=db"
conn.Open
Set conn = Server.CreateObject("ADODB.Connection")
conn.Connstr="driver={SQL Server};server=(local);uid=sa;pwd=sa;database=db"
conn.Open
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询