如何打开一个带密码的ACCESS数据库?
我写了下面的代码:
set conn=server.createobject( "adodb.connection ")
conn.open "driver={microsoft access driver (*.mdb)};psw=a98229e0;dbq= "&server.mappath( "users.mdb ")
exec= "select user from user_base "
set rs=server.createobject( "adodb.recordset ")
rs.open exec,conn,1,1
'循环遍历记录
Find = 0
do while not rs.eof
UserName = rs( "user ")
If UserName = Users Then
Find = 1
Exit Do
End If
rs.movenext
loop
'关闭数据库
rs.close
set rs=nothing
conn.close
set conn=nothing
第二句打开的时候密码设置了,但总有错误,请问应该怎么改?
------解决方案--------------------conn.open "driver={microsoft access driver (*.mdb)};psw=a98229e0;dbq= "&server.mappath( "users.mdb ") , ' ', '密码 '
------解决方案--------------------dim rs
rs.open "driver={microsoft access driver (*.mdb)};psw=a98229e0;dbq= "&server.mappath( "users.mdb ") , ' ', 'a98229e0 '
------解决方案--------------------同意楼上的
------解决方案--------------------dim conn
dim dbpath
set conn=server.createobject( "adodb.connection ")
DBPath = Server.MapPath( "db/db.mdb ")
conn.Open "driver={Microsoft Access Driver (*.mdb)};uid=;pwd=sz168sz168sz168pj41;dbq= " & DBPath
conn.CursorLocation = adUseClient
------解决方案--------------------顶