OleDbException: Could not use ''; file already in use.

OleDbException: Could not use ''; file already in use.

Post by Elissa Setar » Thu, 11 Apr 2002 02:47:02

I have an application that uses  an Access Database to populate a
calendar Control.  When the application is run on the local server it
works fine.  When I put the application on a remote server the
application crashes and I get the following error
 System.Data.OleDb.OleDbException: Could not use ''; file already in

The error doesn't appear consistantly. Sometimes I can advance the
calendar a few months without crashing, Other times it crashes trying
to display for the first time.  Sometimes I can update the database
sometimes I can't. The server's
host assigned full permission to the database. The query is a simple
one.(return a few fields if the dates match). I open  the connection
fill a dataset and close the connection immediately. Any ideas on what
I'm doing wrong?

Thanks for your help,
Elissa Setareh


OleDbException: Could not use ''; file already in use.

Post by Danielle Nguy » Wed, 17 Apr 2002 07:53:06

Hello Elissa,

Access needs more permission that just permission to the database.  When
you run a query against your Access database, it also creates .ldb file.  
Sometimes Access will create this in the folder where Access resides,
sometimes temp folder.  Make sure you have full permission to the folder of
your Access database and full permission to your temp folder.  If you don't
have enough permission sometimes, Access can create the ldb and not able to
deleted, thus this error.   Another problem that can cause this error is;
not enough space on the temp folder for access to create tmp db for
joining.  make sure that the temp folder is in the drive that has plenty of
space.   If space is the problem you can change your environment variables
to have the tmp and temp point to a folder in a location that has more

If this does not do it for you. check out this article.  folder permission
is still the same,  the account you have to grant permission to may be
Q253604 - PRB: Microsoft Access Database Connectivity Fails in ASP
Q306158 - INFO: Implementing Impersonation in an ASP.NET Application

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit


1. The id 'ctrl1' is already used by another control

Hi all.
Why I get this error msg?
My code:

SQLCommand sqlCommand = new SQLCommand(txbQuery.Text, myConnection);
SQLDataReader dr;
sqlCommand.Execute(out dr);

TableRow tbRow = new TableRow();
TableCell tbCell = new TableCell();

    DataGrid dgGrid = new DataGrid();
    dgGrid.DataSource=dr; // *
tbCell.Controls.Add(new LiteralControl("Nothing"));

tbQuery.Rows.Add(tbRow);  // <- here is the line with error msg

When I remove * line everything is ok.
I cannot find ctrl1, but every time I get this error.

Thank you for any help.

2. SA with old Beeb progs.

3. Using Micro-Emacs with TDI Modula-2/ST

4. Error - Could not use ''; file already in use.- please help!

5. CSA Derringer, A2091 and Zip Drive

6. Cound not use ''; file already in use error

7. Manually Register an OCX ??

8. Can not access file 'xxxx.' because it is being used by another process

9. Can not access file 'stdole' because it is being used by another process.

10. The 'using' directive uses the "=" sign ambiguously with aliases

11. Using 'double x' in VC++ gives 'float x'?

12. VSS complains about missing file '...data\arhaaaaa' upon checkin; using VFP6