Thanks!
What must I do to be absolutely sure that the connection is closed. This is
the function I'm using:
public DataSet GetFromAccessDatabase(String SQLQuery)
{
OleDbConnection conn = new OleDbConnection(this._ConnectionString);
OleDbCommand select = new OleDbCommand(SQLQuery);
OleDbDataAdapter dataAD = new OleDbDataAdapter();
dataAD.SelectCommand = select;
select.Connection = conn;
DataSet mds = new DataSet();
dataAD.Fill(mds);
select.Connection.Close();
dataAD.Dispose();
conn.Dispose();
select.Dispose();
return mds;
}
Is it a good solution to try deleting the .ldb file before each database call?
One more thing. The database is on a Novell Server and I heard that
sometimes windows and Novell doesn't communicate to well and that perhaps
Novell never gets the message that the database is closed. Is this possible
and if so, what could be the workaround?
/Miro
"Robbe Morris [C# MVP]" wrote:
[color=blue]
> Access is not a good fit for web applications. I've seen your
> error occur often times when you don't properly close
> the connection "in every instance" and the lock file
> gets left.
>
> --
> Robbe Morris - 2004/2005 Microsoft MVP C#
>
http://www.masterado.net
>
>
>
>
>
> "Miro" <Miro@discussions.microsoft.com> wrote in message
> news:18C98472-C6B4-4BC8-8217-0DD5937527AC@microsoft.com...[color=green]
> > I've read a couple of threads on this error but none of them could help me
> > so
> > I'm posting myself.
> >
> > When I try open and read (not update) an ACCESS database on a network
> > share
> > I occasionally get:
> >
> > "Could not use ''; file already in use." error.
> >
> > This always happens when the database is open but sometimes even when it's
> > not. Not manually anyway. I consequently use DataAdapter.Fill() method
> > which
> > should close the connection, right? Anyway, It must work even when the
> > database is open (not design mode). It does so when I run the application
> > against a database on the webbserver. What's the difference when its on a
> > network share? The IUSR has full rights on the database-folder. And as I
> > said
> > earlier it works, but not always so it's unlikely a basic security
> > problem.
> > There must be some way to force ASP.NET to read an open database. Can
> > anybody
> > please help me?
> >
> > /Miro[/color]
>
>
>[/color]