Re: .ldb file stays when connection is closed
From: Derrick (Derrick_no_spam_at_geostrategies.ca)
Date: 02/25/04
- Next message: Derrick: "Re: .ldb file stays when connection is closed"
- Previous message: Wes Brown: "Re: Data access class design question"
- In reply to: Kevin Yu [MSFT]: "Re: .ldb file stays when connection is closed"
- Next in thread: Scott M.: "Re: .ldb file stays when connection is closed"
- Reply: Scott M.: "Re: .ldb file stays when connection is closed"
- Messages sorted by: [ date ] [ thread ]
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."
>
- Next message: Derrick: "Re: .ldb file stays when connection is closed"
- Previous message: Wes Brown: "Re: Data access class design question"
- In reply to: Kevin Yu [MSFT]: "Re: .ldb file stays when connection is closed"
- Next in thread: Scott M.: "Re: .ldb file stays when connection is closed"
- Reply: Scott M.: "Re: .ldb file stays when connection is closed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|