Home All Groups Group Topic Archive Search About
Author
13 Oct 2005 9:59 AM
avemariasoftsolutions@gmail.com
Hi all

I am doing a project in visual basic 6.0 .

Is there any option/method to protect a file from deleting.

Please help me.

Author
13 Oct 2005 11:19 AM
J French
On 13 Oct 2005 02:59:54 -0700, "avemariasoftsoluti***@gmail.com"
<avemariasoftsoluti***@gmail.com> wrote:

>Hi all
>
>I am doing a project in visual basic 6.0 .
>
>Is there any option/method to protect a file from deleting.

Possibly: SetAttrib

Depends what you are nervous about.
Author
13 Oct 2005 11:55 AM
Phill. W
<avemariasoftsoluti***@gmail.com> wrote in message
news:1129197593.923921.246860@z14g2000cwz.googlegroups.com...

> Is there any option/method to protect a file from deleting.

Prevent a file from being deleted?
Nothing that the User can't override if they feel so included.

The simplest (and the one that /keeps/ catching me out) is to
set the File's Hidden or ReadOnly Attribute, as in

SetAttr( "file", GetAttr( "file" ) And Not vbHidden )

This takes advantage of the [odd] fact that VB's "Kill" statement,
which is how you delete files, is a bit "short-sighted"; make a file
Hidden /or/ ReadOnly and "Kill" just can't "see" it to get rid of it.

HTH,
    Phill  W.
Author
14 Oct 2005 5:19 AM
AMSS
Supose the Folder Option has been set to "show hidden files and
folders" then it is posible to change/delete the file.
Author
16 Oct 2005 8:50 PM
Ralph
"AMSS" <avemariasoftsoluti***@gmail.com> wrote in message
news:1129267179.125524.79600@g49g2000cwa.googlegroups.com...
> Supose the Folder Option has been set to "show hidden files and
> folders" then it is posible to change/delete the file.
>

Belated reply. I am sure you have tried it by now and discovered that "being
able to see it" in Explorer, makes no difference, to the other's responses.