Home All Groups Group Topic Archive Search About

.LDB File not being deleted after oledbconnection.close being call

Author
12 Jan 2006 2:47 PM
Chris McNear
I have seen a thread similar to this problem earlier in this thread
unfortuantely did not really see a solution.  My problem is as follows.
I am opening a connection to an access database performing some operations
and the closing (typical use)  I notice however that upon calling the
oledbconnection.close method the .ldb file that is created is not deleted. I
am also unable to delete this file myself until I exit the program.  I have
tried setting the connection object to nothing and disposing it after the
connection is closed as well as callin gc.collect, all to no avail.  I have
connection pooling disabled within the connection string.  I am stumped and
would greatly appreciate any help anyone can give me.  FYI I am using .net
framework 2.0 and visual basic 2005. PLEASE HELP!

Author
12 Jan 2006 8:18 PM
Paul Clement
On Thu, 12 Jan 2006 06:47:04 -0800, Chris McNear <ChrisMcN***@discussions.microsoft.com> wrote:

¤ I have seen a thread similar to this problem earlier in this thread
¤ unfortuantely did not really see a solution.  My problem is as follows.
¤ I am opening a connection to an access database performing some operations
¤ and the closing (typical use)  I notice however that upon calling the
¤ oledbconnection.close method the .ldb file that is created is not deleted. I
¤ am also unable to delete this file myself until I exit the program.  I have
¤ tried setting the connection object to nothing and disposing it after the
¤ connection is closed as well as callin gc.collect, all to no avail.  I have
¤ connection pooling disabled within the connection string.  I am stumped and
¤ would greatly appreciate any help anyone can give me.  FYI I am using .net
¤ framework 2.0 and visual basic 2005. PLEASE HELP!

Could you post an example of your code?


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
12 Jan 2006 11:00 PM
Chris McNear
Well I have actually gone a different direction with it now but would still
like to find a solution as I have other places it would be useful. the code
is basically as follows ( sorry no details allowed)

dim x as oledbconnection
dim y as oledbCommand

' I AM GOING TO PARAPHRASE THE CONNECTION STRING

x = new oledbconnection("Provider =Jet 4; data source=mydb;system database=
my system;userid=me;password=pw;ole db services=-4;persist security info =
false;

'TABLE IS ALREADY FILLED DataTable

x.open
for each row as dataRow in Table.Rows
   'generate insert statement here
   'execute insert statement here
end for

x.close

That's the code in a nutshell. Thanks for the help.
Show quote
"Paul Clement" wrote:

> On Thu, 12 Jan 2006 06:47:04 -0800, Chris McNear <ChrisMcN***@discussions.microsoft.com> wrote:
>
> ¤ I have seen a thread similar to this problem earlier in this thread
> ¤ unfortuantely did not really see a solution.  My problem is as follows.
> ¤ I am opening a connection to an access database performing some operations
> ¤ and the closing (typical use)  I notice however that upon calling the
> ¤ oledbconnection.close method the .ldb file that is created is not deleted. I
> ¤ am also unable to delete this file myself until I exit the program.  I have
> ¤ tried setting the connection object to nothing and disposing it after the
> ¤ connection is closed as well as callin gc.collect, all to no avail.  I have
> ¤ connection pooling disabled within the connection string.  I am stumped and
> ¤ would greatly appreciate any help anyone can give me.  FYI I am using .net
> ¤ framework 2.0 and visual basic 2005. PLEASE HELP!
>
> Could you post an example of your code?
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>
Author
13 Jan 2006 2:21 PM
Paul Clement
On Thu, 12 Jan 2006 15:00:02 -0800, Chris McNear <ChrisMcN***@discussions.microsoft.com> wrote:

¤ Well I have actually gone a different direction with it now but would still
¤ like to find a solution as I have other places it would be useful. the code
¤ is basically as follows ( sorry no details allowed)
¤
¤ dim x as oledbconnection
¤ dim y as oledbCommand
¤
¤ ' I AM GOING TO PARAPHRASE THE CONNECTION STRING
¤
¤ x = new oledbconnection("Provider =Jet 4; data source=mydb;system database=
¤ my system;userid=me;password=pw;ole db services=-4;persist security info =
¤ false;
¤
¤ 'TABLE IS ALREADY FILLED DataTable
¤
¤ x.open
¤ for each row as dataRow in Table.Rows
¤    'generate insert statement here
¤    'execute insert statement here
¤ end for
¤
¤ x.close
¤

Well I don't see anything obvious unless you have another connection somewhere to the database. You
could take a peek at the .LDB file to see if it gives you any clues.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;176670


Paul
~~~~
Microsoft MVP (Visual Basic)

AddThis Social Bookmark Button