Need help in VB6.0-MS Access Database Connectivity


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Need help in VB6.0-MS Access Database Connectivity

  1. #1
    Join Date
    Jul 2006
    Posts
    14

    Need help in VB6.0-MS Access Database Connectivity

    Hi,

    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)

    Need Solution:

    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.....???????


    Thanks
    Lotus123

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    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.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Feb 2004
    Location
    Longueuil, Québec
    Posts
    577
    Hi Lotus.

    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", dbOpenSnapshot)
    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.
    Jacques Bourgeois
    JBFI
    http://www3.sympatico.ca/jbfi/homeus.htm

Similar Threads

  1. Database not properly created
    By Arjuna in forum Database
    Replies: 2
    Last Post: 07-25-2007, 04:22 AM
  2. Replies: 1
    Last Post: 09-17-2002, 11:57 PM
  3. How to analyze corrupted Access databases
    By Raffaele in forum VB Classic
    Replies: 15
    Last Post: 06-27-2001, 10:28 AM
  4. Create an Access 97 database from txt using VB6.0
    By Maury Clay in forum VB Classic
    Replies: 3
    Last Post: 04-06-2000, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center