Solved

assign password to existing access database through vb at runtime

Posted on 2003-11-23
6
243 Views
Last Modified: 2013-12-25
i have an  mdb in access, to make it secure, i want a code in vb6 which will assign password to mdb, so when user opens the database exclusively , it shld ask for the password.in access security under which password set property is there, i want to set that property but through vb
0
Comment
Question by:tanvi
[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
6 Comments
 
LVL 8

Expert Comment

by:MYLim
ID: 9809024
i do like this:
1.Set password to Access database. (Ex:Password = Admin)
2.i will create a Password field to Chk user Login - MyUsername,MyPassword,MyLevel.
   (EX:Username = tanvi ,Password = 123 ,Level = Administrator)
3.When Program start then i will use Password 'Admin' to Connect to Access.
4.After Connect Access,i can retrieved data from access then compare with username,
 password which User Enter.
EX: if txtUsername.text <> RsFromAccessDatabase.fields(MyUsername) and
          txtPassword.text <> RsFromAccessDatabase.fields(MyPassword)  then
        msgbox "Inccorrect Password,Try again"
       else
           LoginSuccessed = true
           form1.show
       end if

0
 
LVL 8

Expert Comment

by:MYLim
ID: 9809043
as i know,Access only can have one password.
0
 

Author Comment

by:tanvi
ID: 9809534
i want to set access password,at runtime, not like this
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 50 total points
ID: 9810022
In that case you can assign a password in Access.  Then your application should display a form which asks the user for password and user information.  You should then use this information as part of the concatinated connection string then you try to access Access:

strUser = Trim(txtUsername.Text)
strPass = Trim(txtPassword.Text)

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=c:\somepath\mydb.mdb;" & _
           "Jet OLEDB:System Database=MySystem.mdw", strUser, strPass


Leon
0
 
LVL 1

Expert Comment

by:ayufans
ID: 10512115
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- answered by leonstryker

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

ayufans
Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

762 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