Need help in VB6.0-MS Access Database Connectivity
Am using MS Access as a back-end for my VB Program. And am using DAO method in my VB Application like below,
Set db = OpenDatabase("C:\Stores.mdb")
Set rs = db.OpenRecordset("Inventory", dbOpenDynaset)
I want to put my Access database file in one windows XP system, and other network users want to access my VB application. I want to give read-only permissions for some users, and also want to give read-write permissions to rest of them.
I've tried to gave folder level sharing permissions in windows XP professional edition. Its working when i shared the folder with read and change permission. But i've checked, others also can able to delete or updating the database file.
I don't want like that. I want to share the folders using Map network Drive option, and others can able to access my DB records in my VB Application. But the same time, I've to block the users, to corrupt or deleting my DB file. How wil i do?
Any other solution.......Pls. anybody explain me....
I don't have knowledge in Network. pls. help me. how to solve this problem.....???????
Users who require write access to the database will require full permissions to the folder where the database is located. Unfortunately there is no workaround.
Full permissions are required in order for the Jet database engine to create, modify and delete the corresponding .LDB file that is created when an Access database has been opened for write access.
Microsoft MVP (Visual Basic)
Try to control the readonly from your code.
From your VB application, you can set the recordset to be readonly 2 ways :
db.OpenRecordset("Inventory", dbOpenDynaset, dbReadOnly)
Your VB6 application could thus validate the user and decide if it opens the Recordset with your original code (read-write) or with one of those 2 (read-only).
I simplify here, but the snapshot is usually more interesting when you do not have a lot of data. It creates a readonly copy of the data on the user machine. The ReadOnly Dynaset is usually more interesting if the amount of data is huge, since it simply creates a cursor on the data and brings that data on the client machine as needed.
If the users are not advanced computer users, that should be sufficient. They might not even know that they are using an Access database in the background of your application.
If you are fear that since the users see the mdb file in a read-write directory and might use another application or Access itself to open it, bypassing the security you built into your own VB6 application, secure the database. The subject is discussed in on-line help, and the latest versions of Access have a wizard that helps you doing s. It is in Tools... Security ... User-Level Security Wizard.
Once a database is secured, a user name and password is needed to open the database. Even power users won't be able to get in, except through your application, where you control the access .
In your application you will however have to open the database through a Workspace object that will enable you to provide the necessary username and password. Once again, look into the online help to see how to use the Workspace object.
Hard topic to explain in a few words. Hope this helps and guide you to a solution.
By Arjuna in forum Database
Last Post: 07-25-2007, 03:22 AM
By jack in forum VB Classic
Last Post: 09-17-2002, 10:57 PM
By Raffaele in forum VB Classic
Last Post: 06-27-2001, 09:28 AM
By Maury Clay in forum VB Classic
Last Post: 04-06-2000, 10:06 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL