马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#3060a0 border=0>
<TBODY>
<TR>
<TD vAlign=center align=middle height=38><FONT color=#ffffff>作者:yanek(转) 来源:开发者俱乐部 加入时间:2002-12-12 蓝宝石软件站</FONT> </TD></TR>
<TR>
<TD vAlign=top height=48><FONT color=#ffffff>如果你用ODBC connection (DSN or DSN-less)来访问远端的(UNC path)数据库, OLEDB会出现以下错误信息: <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error ’80004005’ <BR><BR><BR>[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. <BR><BR><BR> 你完全可以避免这种错误--ASP和ActiveX支持两种方式打开MDB文件的DSN-less连接,或由其它机器访问MDB文件。 <BR><BR><BR>1. DAO database (only for small load) <BR><BR><BR>Dim File, Conn, RS <BR><BR>Const ReadOnly = False <BR><BR>File = "\\server\share\file.mdb" <BR><BR>Set Conn = CreateObject("DAO.DBEngine.35").Workspaces(0).OpenDatabase(File,,ReadOnly) <BR><BR>Set RS = Conn.OpenRecordset(SQL) <BR><BR><BR>2. ADO + Jet OLE DB provider <BR><BR><BR>Dim Conn, RS <BR><BR>Set Conn = CreateObject("ADODB.Connection") <BR><BR>Conn.Provider = "Microsoft.Jet.OLEDB.4.0" <BR><BR>Conn.Open "\\server\share\file.mdb" <BR><BR>Set RS = Conn.Execute(SQL) <BR><BR><BR>你得确定使用ASP的用户有NT的数据库及共享访问权限。 <BR><BR>假定有权限的话,你亦可访问其它机器中的开放数据连接: <BR><BR><BR>http://www.pstruh.cz/ <BR><BR>Set UM = CreateObject("UserManager.Server") <BR><BR>UM.LogonUser "Login with the rights", "assword", "Domain" <BR><BR>... <BR><BR>open database <BR><BR>... <BR><BR>UM.RevertToSelf <IMG height=1 src="http://soft.bluejewel.net/down_info.asp?id=43" width=1 border=0></FONT></TD></TR></TBODY></TABLE> |