最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用ASP打开远端MDB文件
时间:2022-06-30 11:28:26 编辑:袖梨 来源:一聚教程网
如果你用ODBC connection (DSN or DSN-less)来访问远端的(UNC path)数据库, OLEDB会出现以下错误信息:
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的数据库及共享访问权限。
假定有权限的话,你亦可访问其它机器中的开放数据连接:
'http://www.pstruh.cz
Set UM = CreateObject("UserManager.Server")
UM.LogonUser "Login with the rights", "Password", "Domain"
...
open database
...
UM.RevertToSelf
蜘蛛精 译
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的数据库及共享访问权限。
假定有权限的话,你亦可访问其它机器中的开放数据连接:
'http://www.pstruh.cz
Set UM = CreateObject("UserManager.Server")
UM.LogonUser "Login with the rights", "Password", "Domain"
...
open database
...
UM.RevertToSelf
蜘蛛精 译
相关文章
- 炉石传说血DK卡组怎么样 炉石传说血DK卡组推荐介绍 11-05
- 咒术回战幻影夜行官网在哪里 咒术回战幻影夜行官网地址介绍 11-05
- 蚂蚁庄园今天答题答案2024年10月26日 11-05
- 以闪亮之名变装物语甜趣篇怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 闪耀暖暖永夜禁锢活动介绍 11-05