
VB4,opening database w/o write access to file
Quote:
> I wrote a simple program that just accesses an Access2 db. I don't won't
> anyone to have write access to the files in the directory, they just read
> the data and print a report (
Crystal Report).
> So I only gave them Read and File Scan rights to the directory. But when
> they try to open it (non-exclusive, read-only) it tells me it can't lock
> the file. The only way i've been able to make it work is to give them
> Write access to the file/directory. That defeats the purpose because, if
> they have a db program that can use .mdb files, they can change the data.
> Any ideas? I've been out of programming for awhile, so maybe I'm just
> doing something (else ;) stupid
Even if you are only reading a database file, the system still needs write
access to work ( Something to do with the indexing ). If you want to
protect the database from un-authorised use, try putting a password on the
tables and then prompt the user for the password when connecting via Visual
Basic.
However, you need a copy of Access to create the necessary security file..
NB: If you have the database on an NTFS file system ( Windows NT ) you can
set additional security by setting the delete flag off - this will prevent
rogue users from deleting the entire database..
Hope this helps..
PM..