用ASP打开远端MDB
microsoft ole db provider for odbc drivers error ’80004005’
[microsoft][odbc microsoft access driver] the microsoft jet database engine cannot open the file ’(unknown)’. it is already opened exclusively by another user, or you need permission to view its data.
你完全可以避免这种错误--asp和activex支持两种方式打开mdb文件的dsn-less连接,或由其它机器访问mdb文件。
1. dao database (only for small load)
dim file, conn, rs
const readonly = false
file = "\serversharefile.mdb"
set conn = createobject("dao.dbengine.35").workspaces(0).opendatabase(file,,readonly)
set rs = conn.openrecordset(sql)
2. ado + jet ole db provider
dim conn, rs
set conn = createobject("adodb.connection")
conn.provider = "microsoft.jet.oledb.4.0"
conn.open "\serversharefile.mdb"
set rs = conn.execute(sql)
你得确定使用asp的用户有nt的数据库及共享访问权限。
假定有权限的话,你亦可访问其它机器中的开放数据连接:
https://www.pstruh.cz/
set um = createobject("usermanager.server")
um.logonuser "login with the rights", "password", "domain"
...
open database
...
um.reverttoself
上一篇: 5.7英寸以上屏幕机型盘点