[AccessD] The microsoft access database engine can not open or write to the file

Stuart McLachlan stuart at lexacorp.com.pg
Mon Apr 16 23:03:51 CDT 2012


What is the recordsource of  Me.subCtlDisplay ?

Failing code not shown.
What is the complete FillTable Proc up and including the DCount line?

-- 
Stuart

On 16 Apr 2012 at 20:31, Doug Murphy wrote:

> I opened the application in Access 2010 and the functionality failed.
> In stepping through the code I delete the old querydef, create the new
> one and then run a dCount against it to get a record count. The DCount
> call generates the error message: 
> 
> 'I:\Access Work\AUGSD Presentations\Excel Import\VendorsList3.xls'. It is already
>  opened exclusively by another user, or you need permission to view and write its
>  data. at Line Number = 0 in procedure FillTable of VBA Document
>  Form_frmImportVendorExcel2
> 
> While the code is running in debug mode I get a similar message if I try to open the new querydef from the query window. After I step out of the code the query opens fine. Any suggestions on how to release whatever seems to have exclusive control of the query? The code that does the above work follows:
> 
>       With CurrentDb
>         .QueryDefs.Delete CurrentDb.QueryDefs("qryVendorExcelImportAttachToExcel").Name
>         Me.subCtlDisplay.Requery
>         sSQLExcel = "SELECT " & sSheetName & ".*,* FROM " & sSheetName & " IN '" & sPath & "'[Excel 8.0;];"
>         Set qdfTemp = .CreateQueryDef("qryVendorExcelImportAttachToExcel", sSQLExcel)
>         .Close
>       End With
> 
> Any insight into this problem is appreciated.
> 
> Doug
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list