PRB: File Access Denied When Opening a Table Accessed by Using ADO (260856)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q260856 SYMPTOMS
When you attempt to open a Visual FoxPro table for exclusive use after the table has been accessed by using an ActiveX Data Object (ADO), the following error message appears:
File access is denied
This error message may continue to occur for up to 60 seconds after the table has been released from the ADO connection.
CAUSE
When an application creates an OLE DB data source object (through ADO or an OLE DB consumer), OLE DB services query the data provider for supported information and provide a proxy data source object to the application. To the consuming application, this proxy data source object looks like any other data source object, but, in this case, setting properties merely caches the information in the local proxy. When the application opens a connection in ADO, the proxy data source object checks whether any unused connections already exist that match the specified connection information. If a matching unused connection is found, rather than creating a new object, setting properties, and establishing a new connection to the database, the proxy data source object uses the existing initialized data source object. When the application releases the data source object, it is returned to the pool. Any data source object that is released by the application and not reused after 60 seconds is automatically released from the pool.
RESOLUTION
Disable ADO Resource pooling in the ADO Connection string.
Resource pooling can be controlled in the connection string used to connect to a data source by adding one of the following OLE DB Services clauses, as appropriate:
lcConnectString="DRIVER=Microsoft Visual FoxPro Driver;" + ;
"SourceType=DBF;SourceDB="+SYS(5)+SYS(2003) + ";" + ;
"Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE;" + ;
"OLE DB Services = 0")
lcConnectString="DRIVER=Microsoft Visual FoxPro Driver;" + ;
"SourceType=DBF;SourceDB="+SYS(5)+SYS(2003) + ";" + ;
"Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE;" + ;
"OLE DB Services = -2")
lcConnectString="DRIVER=Microsoft Visual FoxPro Driver;" + ;
"SourceType=DBF;SourceDB="+SYS(5)+SYS(2003) + ";" + ;
"Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE;" + ;
"OLE DB Services = -4")
lcConnectString="DRIVER=Microsoft Visual FoxPro Driver;" + ;
"SourceType=DBF;SourceDB="+SYS(5)+SYS(2003) + ";" + ;
"Exclusive=NO;BackGroundFetch=NO;NULL=NO;Collate=MACHINE;" + ;
"OLE DB Services = -6")
STATUS
This behavior is by design.
REFERENCES
For additional information on ADO Resource Pooling, please see the following Web site:
For additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
245267 DOC: 'OLEDB_SERVICES = -2' Does Not Disable Autoenlistment
176056 INFO: ADO/ASP Scalability FAQ
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbCodeSnippet kbDatabase kbprb KB260856 kbAudDeveloper |
---|
|