Re: .ldb file stays when connection is closed

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Derrick (Derrick_no_spam_at_geostrategies.ca)
Date: 02/25/04


Date: Wed, 25 Feb 2004 19:21:41 GMT

Thanks for the quick response. You understood the problem correctly. I
tried using that property, but the .ldb is still there after the connection
is closed. When the entire application closes, the .ldb file disappears.

This is the connect string. Did I do anything wrong there?

Provider=Microsoft.Jet.OLEDB.4.0;OLE DB Services=-4; Data
Source=C:\delete.mdb.

Just in case I am pursuing the wrong angle, maybe we should examine my
logic. Here is what I am trying to do - is this a reasonable approach:

public sub create dataFile()
    try
        ' create data base file
        ' connect to the file
        ' fill the data base with default data
    catch ex as exception
        ' if file is created, delete it (doesn't work as long as there is
an .ldb file)
    finally
        ' if connection is open, disconnect it
    end try
end sub

Thanks for the help

Derrick
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:rXPXdw2%23DHA.3124@cpmsftngxa06.phx.gbl...

> Hi Derrick,
>
> Thank you for posting in the community!
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that there is an .ldb file remaining after
> you have closed the connection to the .mdb file. If there is any
> misunderstanding, please feel free to let me know.
>
> Just a Scott mentioned, ADO.NET uses connection pooling by default. After
> you have closed the connection, the connection object will not be disposed
> actually. It is put back into the pool. It will only be disposed after its
> lifetime has expired or the application is over. Pooling connections can
> significantly enhance the performance and scalability of your application.
>
> I think you can disable connection pooling by adding "OLE DB Services=-4;"
> in the OleDb connection string. The .ldb file will disappear as soon as
you
> close the connection.
>
> For more information about connection pooling in .NET OleDb data provider,
> please check the following link:
>
>
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconnectingtooledbd
> atasourceusingadonet.asp
>
> Does this answer your question? If anything is unclear, please feel free
to
> reply to the post.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



Relevant Pages

  • Re: MS Access LDB file (lock) and INSERT Failure
    ... Access automatically creates an ldb (lock file) when you open a connection ... > "INSERT INTO Logins ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MS Access LDB file (lock) and INSERT Failure
    ... > Access automatically creates an ldb when you open a connection ... >> "INSERT INTO Logins ... >> When user logins in, I update the DB successfully as below: ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: ADO Connection to Access leaves .ldb file behind
    ... creating any MSACCESS.EXE or .ldb. ... ADO does that there are 3 of us who would be most interested. ... I am simply opening a connection, getting some records into a Recordset, ...
    (microsoft.public.data.ado)
  • Re: Couldnt Lock File Error
    ... so that's why my search on .tdb didn't return anything that made sense. ... was thinking that maybe you meant .ldb instead. ... connection function, I use a database password (which I do know that there ... start the app and do a compare against a user table in the database. ...
    (microsoft.public.vb.general.discussion)
  • Re: .ldb file stays when connection is closed
    ... ADO.NET uses connection pooling by default. ... The .ldb file will disappear as soon as you ... "This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.dotnet.framework.adonet)