Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

assign password to existing access database through vb at runtime

Posted on 2003-11-23
6
Medium Priority
?
248 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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 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…
Suggested Courses

715 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