Microsoft JScript 运行时错误 错误 '800a1391' 'server' 未定义 /conn.asp,行 10
前十行代码如下:<%Response.Expires=0Response.CacheControl="no-cache"vardb,conn,connstr;varSql...
前十行代码如下:<%
Response.Expires=0
Response.CacheControl="no-cache"
var db,conn,connstr;
var SqlDatabaseName = "##$@#@$movcmsbook"
var SqlPassword = "sa"
var SqlUsername = "sa"
var SqlLocalName = "(local)"
conn=server.createobject("ADODB.connection") 展开
Response.Expires=0
Response.CacheControl="no-cache"
var db,conn,connstr;
var SqlDatabaseName = "##$@#@$movcmsbook"
var SqlPassword = "sa"
var SqlUsername = "sa"
var SqlLocalName = "(local)"
conn=server.createobject("ADODB.connection") 展开
1个回答
展开全部
看看下面的语句,是个标准的conn,你不觉得你少了什么吗?
dim db,conn,connstr
db="ABC.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
If Err Then
err.Clear
Set conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
dim db,conn,connstr
db="ABC.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
If Err Then
err.Clear
Set conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询