"80004005" Couldn't lock file "error solution

zhaozj2021-02-16  51

When connecting access, "80004005" Couldn't Lock File "error solved

Applicable to:

Microsoft Active Server Pages Microsoft Data Access Components 1.5 Microsoft Data Access Components 2.0 Microsoft Data Access Components 2.1 Microsoft Data Access Components 2.1 SP1 Microsoft Data Access Components 2.1 SP2 Microsoft Data Access Components 2.5 Microsoft Data Access Components 2.5 SP1 Microsoft Data Access Components 2.5 SP2 Microsoft Data Access Components 2.6

This Article WAS Previously Published Under Q306441 Problem Cannot return the following error message when we try to connect to an MS Access database with ActiveX Data Objects (ADO) and Open Database Connection (ODBC):

Microsoft OLE DB Provider for ODBC Drivers Error '80004005' [Microsoft] [ODBC Microsoft Access 97 Driver] COULDN '' LOCK file.

Reason

The result of the above error message is because you don't have permissions to create a Lock File (.ldb) file for the MS Access database. The system default is that Lock File (.ldb) is created in one as a Microsoft Access .mdb file. MDB file.

Solution

Perform it as follows:

1. Users who allow access to databases (usually IUSR_ <

Computername> Accounts fully dominate this shared folder.

2. Since the lock file (.ldb) file is often set to read-only, in sharing is often restricted. So, we can try to use the following demonstration code to change the connection method:

Set conn = server.createObject ("adoDb.connection")

Conn.mode = admodesharedenywrite '8

'Definition in Adovbs.Ic

'---- ConnectModeenum VALUES ----

'Const admodeunknown = 0

'Const admoderead = 1

'Const admodewrite = 2

'Const AdmodeReadwrite = 3

'Const admodesharedenyread = 4

'Const admodesharedenywrite = 8

'Const admodesharexclusive = & hc

'Const admodesharedenynone = & h10

bibliography

To learn more, please click on the following:

174943 PRB: 80004005 "Couldn't Use '(unknown)'; File Already in Use" 183060 Info: Troubleshooting Guide for 80004005 and Other Error Messages

转载请注明原文地址:https://www.9cbs.com/read-23259.html

New Post(0)