Access = "sss.mdb" '数据库路径
connstr="DBQ="+server.mappath(Access)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
If err Then
err.clear
Set Conn = nothing
response.write "数据库连接出错,请检查连接字串。"
response.end
end If
上面这一段提示“数据库连接出错,请检查连接字串”请问该怎么修改啊
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
dim Access
Access = "Test.mdb" '数据库路径
connstr="DBQ="+server.mappath(Access)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
If err Then
err.clear
Set Conn = nothing
response.write "数据库连接出错,请检查连接字串。"
response.end
end If
%>
</body>
</html>
我试了下,发现是没有问题的啊。莫非其他地方有问题。