Open remote mdb with ASP

Source: Internet
Author: User
Tags dsn odbc connection
Open remote mdb with ASP
  If you use ODBC connection (DSN or DSN-less) to access the remote (UNC path) database, oledb will see the following error message:

Microsoft ole db provider for ODBC drivers error '000000'

[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.

You can avoid this error. asp and ActiveX support two methods to open the DSN-less connection to the MDB file, or access the MDB file from other machines.

1. DAO Database (only for small load)

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)

2. Ado + jet ole db Provider

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)

Make sure that ASP users have nt database and shared access permissions.

If you have the permission, you can also access open data connections on other machines:

Http://www.pstruh.cz/

Set um = Createobject ("usermanager. Server ")

Um. logonuser "login with the rights", "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.