How to use ASP to access the MDB Access database file on a remote computer application tips

Source: Internet
Author: User
Tags odbc connection ole
If you use an ODBC connection (DSN method or otherwise) to an MDB file on a remote computer, this will produce an error:
Microsoft OLE DB Provider for ODBC Drivers error ' 80004005 ' roughly means that the file may be accessed by another user or without sufficient permissions.

Here are two ways to avoid this error:

Way A. Using the DAO engine to access
Dim File, Conn, RS
Const ReadOnly = False
File = "\\server\share\file.mdb"
Set Conn = CreateObject ("DAO. dbengine.35 "). Workspaces (0). OpenDatabase (file,,readonly)
Set RS = Conn.openrecordset (SQL)
Mode B. ADO + Jet OLE DB provider method
Dim Conn, RS
Set Conn = CreateObject ("ADODB. Connection ")
Conn.provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open "\\server\share\file.mdb"
Set RS = Conn.execute (SQL)
To determine that you have sufficient access rights to run an ASP page to access an MDB file on a remote computer, you need to log on to the remote computer before you can access the MDB file and add the following code:
Set UM = CreateObject ("Usermanager.server")
Um. LogonUser "Account", "Password", "Domain"
...
Open Database
...
Um. RevertToSelf
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.