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)
假定有权限的话,你亦可访问其它机器中的开放数据连接:
http://www.pstruh.cz/
Set UM = CreateObject("UserManager.Server")
UM.LogonUser "Login with the rights", "Password", "domain"
...
open database
...
UM.RevertToSelf
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752019/viewspace-975840/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10752019/viewspace-975840/