Hi Ray,

At the point when you attempt to delete the folder, if you brake your 
program there, are you able to delete it via standard windows explorer?

If not, how about closing your program, and trying directly after you 
exit your program?

Sometimes an anti-virus or other tool (such as Indexing service or such) 
might keep hold of the file or folder so you cannot delete it until it 
is done. Also, do you have permission to delete it? Is the folder near a 
Windows UAC protected path? (Such as Program Files, Windows, etc).

If you break your program and then are able to delete the file via 
explorer, none of the above is a problem, it must be your program 
holding it. When you close sqlite (calling close() in the api) it 
releases the file as soon as it is done with any current outstanding 
operations (such as a rollback or vacuum etc.) - but returns an error 
code if anything did not go smoothly. If no error code is returned (i.e 
SQLITE_OK is returned) then the files was definitely released by SQLite 
and something else is holding on to them.



On 2015-03-05 11:23 PM, RNACS - Info wrote:
> Simon,
>
> Does not help.  I put a breakpoint at the "SQLconn = Nothing" statement &
> checked the value of SQLconn.State. It was "Closed", so I continued one &
> still got the error.
>
> Ray
>
> -----Original Message-----
> From: sqlite-users-bounces at mailinglists.sqlite.org
> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Simon
> Slavin
> Sent: Thursday, March 05, 2015 3:58 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] db File Remains Open After Connection is Closed
>
>
>> On 5 Mar 2015, at 8:34pm, RNACS - Info <info at rnacs.com> wrote:
>>
>> The code I am using is:
>>
>>         ' Close license database connection
>>         If Not IsNothing(SQLconn) Then
>>             If SQLconn.State <> ConnectionState.Closed Then
>>                 SQLconn.Close()
>>             End If
>>             SQLconn = Nothing
>>         End If
> After "SQLconn.Close()", check again the state of the connection to see if
> it was successfully closed.  If not, display an error message.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to