?
Solved

opening a secured Access table through VB5

Posted on 1998-06-16
3
Medium Priority
?
141 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

752 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