Solved

assign password to existing access database through vb at runtime

Posted on 2003-11-23
6
246 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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
Course of the Month5 days, 21 hours left to enroll

627 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