Solved

opening a secured Access table through VB5

Posted on 1998-06-16
3
139 Views
Last Modified: 2010-05-03
I have a program that access students marks. I want to create user security on different objects in the database. How do I pass the user name and password to access from VB to access the table.  
0
Comment
Question by:smolloy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
yronnen earned 50 total points
ID: 1463455
You can use security with Access databases with visual basic. In fact, you can use multiple levels of security.

Suppose you have a user called "user1" with password "pw1". Write the following code:

DIM WS as Workspace
dim DB as Database
set WS=DBEngine.CreateWorkSpace("MyWS","User1","pw1")
set DB=WS.OpenDatabase("MyDB.mdb")

The DB database will have the permission you've given to user1.
0
 
LVL 5

Expert Comment

by:yronnen
ID: 1463456
A little note:You must also point to the system database (the one that holds the users and groups information). This is shown blow:

write this code just below the declarations
DBEngine.SystemDB "system.mdw"

0
 

Author Comment

by:smolloy
ID: 1463457
Just what I was looking for Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question