Home All Groups Group Topic Archive Search About
Author
9 Mar 2006 3:37 AM
¢Ù¢×¢Ü¢Õ¢Ò¢Ý¢Û
i have use data reports in my program
for each reports, it will generate a .tmp files
how can i delete it when i exit the program?
i have use
Kill App.Path & "\*.tmp"

but it say "permission denied"

thanks


Author
9 Mar 2006 4:42 AM
MikeD
"¢Ù¢×¢Ü¢Õ¢Ò¢Ý¢Û" <ad***@letskick.net> wrote in message
news:e8i4GryQGHA.4696@tk2msftngp13.phx.gbl...
>i have use data reports in my program
> for each reports, it will generate a .tmp files
> how can i delete it when i exit the program?
> i have use
> Kill App.Path & "\*.tmp"
>
> but it say "permission denied"
>


You're probably not "cleaning up" properly. These temp files should get
deleted automatically if your program is doing proper "house cleaning" (for
example, you're closing connections and and recordset objects used by the
data reports, setting any references to data report objects themselves to
Nothing, etc.).

The fact that you get a permission denied error when you try to delete them
tells me that *something* still has them open and in use.  This could be
because there's still a valid reference to some object.  I'm not familiar
enough with VB's Data Reports to provide much information on it, but it
would make sense to me that if a Data Report create a connection and you
don't close that connection, you might have temp files that can't get
deleted.

--
Mike
Microsoft MVP Visual Basic
Author
9 Mar 2006 4:58 AM
Bob O`Bob
MikeD wrote:
Show quoteHide quote
> "¢Ù¢×¢Ü¢Õ¢Ò¢Ý¢Û" <ad***@letskick.net> wrote in message
> news:e8i4GryQGHA.4696@tk2msftngp13.phx.gbl...
>> i have use data reports in my program
>> for each reports, it will generate a .tmp files
>> how can i delete it when i exit the program?
>> i have use
>> Kill App.Path & "\*.tmp"
>>
>> but it say "permission denied"
>>
>
>
> You're probably not "cleaning up" properly. These temp files should get
> deleted automatically if your program is doing proper "house cleaning" (for
> example, you're closing connections and and recordset objects used by the
> data reports, setting any references to data report objects themselves to
> Nothing, etc.).
>
> The fact that you get a permission denied error when you try to delete them
> tells me that *something* still has them open and in use.  This could be
> because there's still a valid reference to some object.  I'm not familiar
> enough with VB's Data Reports to provide much information on it, but it
> would make sense to me that if a Data Report create a connection and you
> don't close that connection, you might have temp files that can't get
> deleted.
>


It also could trivially be because something ELSE that's running also has
open .tmp files in there.  Often something your application has NO business
messing with.

It's really not a good idea to just ASSUME because something is an obvious
temp file, that you can delete it.

And, for that matter, neither is it necessarily correct to ASSUME, when you
can't delete some file in there, that it represents any kind of problem.

An app should clean up after ITSELF.  Only.



    Bob
--
Author
9 Mar 2006 5:28 AM
Randy Birch
As I recall, Crystal Reports left a temp file for each report run and
wouldn't clean up after itself. The files for the current session were
locked.  I'd recommend the OP write a batch file to run at logon to delete
those files.

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




Show quoteHide quote
"Bob O`Bob" <filter***@yahoogroups.com> wrote in message
news:ud$zGZzQGHA.5908@TK2MSFTNGP14.phx.gbl...
MikeD wrote:
> ""Y"W"\"U"R"]"[" <ad***@letskick.net> wrote in message
> news:e8i4GryQGHA.4696@tk2msftngp13.phx.gbl...
>> i have use data reports in my program
>> for each reports, it will generate a .tmp files
>> how can i delete it when i exit the program?
>> i have use
>> Kill App.Path & "\*.tmp"
>>
>> but it say "permission denied"
>>
>
>
> You're probably not "cleaning up" properly. These temp files should get
> deleted automatically if your program is doing proper "house cleaning"
> (for
> example, you're closing connections and and recordset objects used by the
> data reports, setting any references to data report objects themselves to
> Nothing, etc.).
>
> The fact that you get a permission denied error when you try to delete
> them
> tells me that *something* still has them open and in use.  This could be
> because there's still a valid reference to some object.  I'm not familiar
> enough with VB's Data Reports to provide much information on it, but it
> would make sense to me that if a Data Report create a connection and you
> don't close that connection, you might have temp files that can't get
> deleted.
>


It also could trivially be because something ELSE that's running also has
open .tmp files in there.  Often something your application has NO business
messing with.

It's really not a good idea to just ASSUME because something is an obvious
temp file, that you can delete it.

And, for that matter, neither is it necessarily correct to ASSUME, when you
can't delete some file in there, that it represents any kind of problem.

An app should clean up after ITSELF.  Only.



Bob
--
Author
9 Mar 2006 5:29 AM
KINGDOM
i found that the problem only happen on code area, when i pack it and
install
the problem do not occur, or the tmp files is in other folders

"Bob O`Bob" <filter***@yahoogroups.com>
???????:ud$zGZzQGHA.5***@TK2MSFTNGP14.phx.gbl...
Show quoteHide quote
> MikeD wrote:
>> "¢Ù¢×¢Ü¢Õ¢Ò¢Ý¢Û" <ad***@letskick.net> wrote in message
>> news:e8i4GryQGHA.4696@tk2msftngp13.phx.gbl...
>>> i have use data reports in my program
>>> for each reports, it will generate a .tmp files
>>> how can i delete it when i exit the program?
>>> i have use
>>> Kill App.Path & "\*.tmp"
>>>
>>> but it say "permission denied"
>>>
>>
>>
>> You're probably not "cleaning up" properly. These temp files should get
>> deleted automatically if your program is doing proper "house cleaning"
>> (for example, you're closing connections and and recordset objects used
>> by the data reports, setting any references to data report objects
>> themselves to Nothing, etc.).
>>
>> The fact that you get a permission denied error when you try to delete
>> them tells me that *something* still has them open and in use.  This
>> could be because there's still a valid reference to some object.  I'm not
>> familiar enough with VB's Data Reports to provide much information on it,
>> but it would make sense to me that if a Data Report create a connection
>> and you don't close that connection, you might have temp files that can't
>> get deleted.
>>
>
>
> It also could trivially be because something ELSE that's running also has
> open .tmp files in there.  Often something your application has NO
> business
> messing with.
>
> It's really not a good idea to just ASSUME because something is an obvious
> temp file, that you can delete it.
>
> And, for that matter, neither is it necessarily correct to ASSUME, when
> you
> can't delete some file in there, that it represents any kind of problem.
>
> An app should clean up after ITSELF.  Only.
>
>
>
> Bob
> --