Microsoft KB Archive/306441: Difference between revisions
(importing KB archive) |
m (Text replacement - "&" to "&") |
||
(2 intermediate revisions by the same user not shown) | |||
Line 75: | Line 75: | ||
To resolve this problem, follow these steps: | To resolve this problem, follow these steps: | ||
<ol> | <ol> | ||
<li>Grant the user who is accessing the database (usually the IUSR_ | <li>Grant the user who is accessing the database (usually the IUSR_<''computername''> account) full control to the share or folder.</li> | ||
<li><p>Sometimes permissions are restricted on the share because the file is intended to be read-only. You may want to try to change the connection mode, which the following code demonstrates:</p> | <li><p>Sometimes permissions are restricted on the share because the file is intended to be read-only. You may want to try to change the connection mode, which the following code demonstrates:</p> | ||
<pre class="codesample"> Set Conn = Server.CreateObject("ADODB.Connection") | <pre class="codesample"> Set Conn = Server.CreateObject("ADODB.Connection") | ||
Line 88: | Line 88: | ||
'Const adModeShareDenyRead = 4 | 'Const adModeShareDenyRead = 4 | ||
'Const adModeShareDenyWrite = 8 | 'Const adModeShareDenyWrite = 8 | ||
'Const adModeShareExclusive = & | 'Const adModeShareExclusive = &Hc | ||
'Const adModeShareDenyNone = & | 'Const adModeShareDenyNone = &H10 | ||
</pre></li></ol> | </pre></li></ol> | ||
Latest revision as of 14:12, 21 July 2020
Article ID: 306441
Article Last Modified on 8/11/2006
APPLIES TO
- Microsoft Active Server Pages 4.0
- Microsoft Data Access Components 1.5
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.1 Service Pack 1
- Microsoft Data Access Components 2.1 Service Pack 2
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.5 Service Pack 1
- Microsoft Data Access Components 2.5 Service Pack 2
- Microsoft Data Access Components 2.6
This article was previously published under Q306441
SYMPTOMS
When you use ActiveX Data Objects (ADO) and ODBC to try to connect to a Microsoft Access database, you may receive the following error message:
CAUSE
This error message occurs because you do not have the correct permissions to create the lock file (.ldb) for a Microsoft Access database. By default, a lock file is created in the same folder as the Microsoft Access .mdb file.
RESOLUTION
To resolve this problem, follow these steps:
- Grant the user who is accessing the database (usually the IUSR_<computername> account) full control to the share or folder.
Sometimes permissions are restricted on the share because the file is intended to be read-only. You may want to try to change the connection mode, which the following code demonstrates:
Set Conn = Server.CreateObject("ADODB.Connection") Conn.Mode = adModeShareDenyWrite '8 'From Adovbs.inc '---- ConnectModeEnum Values ---- 'Const adModeUnknown = 0 'Const adModeRead = 1 'Const adModeWrite = 2 'Const adModeReadWrite = 3 'Const adModeShareDenyRead = 4 'Const adModeShareDenyWrite = 8 'Const adModeShareExclusive = &Hc 'Const adModeShareDenyNone = &H10
STATUS
This behavior is by design.
REFERENCES
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
174943 PRB: 80004005 "Couldn't Use '(unknown)'; File Already in Use"
Additional query words: 80004005
Keywords: kbprb KB306441