Create Ready Only Text File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I was wondering
A) Is it even possible to make a text file ready only?
B) If it is possible, how can this be done when creating a new text file in
VBA through Microsoft Access

Thanks

Neil
 
In
NeilGel said:
Hi,

I was wondering
A) Is it even possible to make a text file ready only?
B) If it is possible, how can this be done when creating a new text
file in VBA through Microsoft Access

Check out the SetAttr statement in the online help (while in the VB
Editor environment).
 
Hi Dirk,

Thanks mate, it works a treat. My only issue now is that when I select the
properties of the file, it can easily be switched back to a readwrite by
unticking the flag. Is there a way to lock the properties of the file?

Thanks

Neil
 
Hi Dirk,

In addition to my last question.

Is it possible to secure a text file through VBA so that once it is written,
it cannot be copied, edited or deleted?

Thanks

Neil
 
In
NeilGel said:
Hi Dirk,

Thanks mate, it works a treat. My only issue now is that when I
select the properties of the file, it can easily be switched back to
a readwrite by unticking the flag. Is there a way to lock the
properties of the file?

Probably not to protect it against a user who has adminstrator
privileges on the computer. For limited users, maybe you can do it by
putting the file in a folder where the user has only read privileges, or
set such privileges for the file itself. I can't say I've ever thought
about this, and I don't know a whole lot about it. You'd need
administrator privileges yourself, and I don't know how you'd go about
doing it via code. You need to read up on Windows security, I think.
 
In
NeilGel said:
Hi Dirk,

In addition to my last question.

Is it possible to secure a text file through VBA so that once it is
written, it cannot be copied, edited or deleted?

I have my doubts about being able to protect it against copying, if you
alow the file to be read. The rest falls into the area of Windows
security, and I don't know much about it.
 
Hi Dirk & Neil,

Dirk's right: you can use NTFS permissions to limit a user's ability to edit
or delete a file once written, but the permissions they need in order to read
the file at all are sufficient for them to copy it (whether by copying the
file, opening the file and using the clipboard, or opening the file and doing
Save As).

If you need protection built into the file itself, maybe PDF is what you
need. Acrobat can encrypt a PDF file and limit the user's ability to
extract/print/etc. unless they have the right password.
 
Back
Top