Easiest Way to Make DB App Read Only?

mjb3030

Well-known member
Joined
Aug 14, 2003
Messages
76
I have a fairly standard db application which uses dataadapters to populate datasets from an Access database. I set up the dataadapters using the wizard, so the delete, insert, and update commands were all created automatically.

I have a few users now who need to be able to view the database, but are not permitted to make changes. I figured if I just gave them read only access to the MDB file, everything would be fine, but now they cannot run the program. They get an error stating that the file is either opened exclusively by someone else ( it isnt ) or they do not have permission. My assumption is that, since the dataadapters are set up to handle deletions, updates, and inserts, they cant be instantiated.

Is that correct? If so, what would be the easiest way for me to make a "lite" version of this app that would allow read only? Id prefer not to have to go through and remove all the dataadapters and put in datareaders. If I just go through the wizard and tell it not to create the delete, insert, and update commands will that take care of things?
 
Can you tell us where the error occurs? My guess is youre getting the error when openeing the connection, before any DataAdapters are created or used. Access is pretty particular about opening the database file. Im not an Access guru, but I thought I remember seeing a special param on a connection string that signifies you dont want exclusive access. Maybe try that?

It may simply be that you cant have the DB file readonly.

-ner
 
This is my connection string:

Code:
        ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=\\\\server1\\ldb\\labtests.mdb;" & _
           "User Id=admin;" & _
           "Password="

I never explicitly call conn.open(). I just do a dataadapter.fill(ds). I have never had any problems with multiple users connecting at once. It was only when I changed the rights of certain users to read only did those users have problems.
 
The Jet-Engine, which you are useing, needs WriteAccess to the directory, to
write into the logfile.
Like it or not, you have to grant that or use another DB.
 
Back
Top