Solved

opening a secured Access table through VB5

Posted on 1998-06-16
3
137 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
  • 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 61
Modifying Conditional Format from VBA code 3 56
IF ELSE Statement in Excel Macro VBA 16 64
Publisher:   Unknown     VB.exe Application 1 21
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

777 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