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

x
?
Solved

To protect MSAccess file

Posted on 2002-07-13
12
Medium Priority
?
246 Views
Last Modified: 2011-09-20
Using the below ADO codeing to connect MSAceess , I want to give password to MSAccess file to  protect unauthorised access from users .
     if I am giveing password to MSAccess file using its security option , I can't connect to MSAccess from VB 6.0 , in the below codeing where can I give password , or I want to change my codeing ..

     Public cn As ADODB.Connection
     Public rs As ADODB.Recordset
     Public cmd As ADODB.Command
 
 Set cn = New ADODB.Connection    
    constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\shalimardbs.mdb;Persist Security Info=false"
    cn.Open constr
   Set cmd = New ADODB.Command
   Set cmd.ActiveConnection = cn

     dc.connect
       dc.cmd.CommandText = "SELECT ITEMNAME,WEIGHT From STOCKREGISTER WHERE ITEMCODE =ANY  (SELECT ITEMCODE FROM PREPARATIONCHART WHERE DISHCODE = 'D001' ) ORDER BY ITEMCODE "
         Set dc.rs = New ADODB.Recordset
         Set dc.rs = dc.cmd.Execute
0
Comment
Question by:infoserver
[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
  • 4
  • 3
  • 2
  • +3
12 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 7151517
Set a Password for an Access Database
http://www.freevbcode.com/ShowCode.Asp?ID=354

hongjun
0
 
LVL 33

Accepted Solution

by:
hongjun earned 400 total points
ID: 7151521
Then to connect to the access file, see this
http://www.able-consulting.com/ADO_Conn.htm
Replace the user id and password accordingly.

hongjun
0
 
LVL 1

Expert Comment

by:slavikn
ID: 7151663
You should set a password to the database and then correct your conncetion-string.

constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\shalimardbs.mdb;Persist Security Info=false;Jet OLEDB:Database Password=yourpasssswordddd"
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 33

Expert Comment

by:hongjun
ID: 7152025
slavikn,

You are here long enough to know EE policy. The policy here is to post everyhing in comments. Questionner will then have the option to accept a comment as an answer. Posting as a proposed answer will lock the question and thus restrict the exposure to more experts. We know you are new here and thus is forgiven. With the current version of EE, you do not have the option to convert your answer to a comment but this can be done by the questioner himself. I advise the questionner to reject his answer so that this question will be released to more experts. You can however accept his comment again if you find it is really helpful.

Thanks
hongjun
0
 
LVL 1

Expert Comment

by:slavikn
ID: 7152036
hongjun,

First of all I am very sorry. Secondly, how did you manage to add a comment if it is forbidden?

Best regards,
slavikn.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7152040
>>how did you manage to add a comment if it is forbidden
This question is not forbidden. It is just being brought to the Locked state and thus reducing exposure to more experts.

hongjun
0
 

Expert Comment

by:jeddha
ID: 7177016
if we are using Crystal Report , How can we give the same password to Crystal Report 8.0
0
 

Author Comment

by:infoserver
ID: 7181679
if we are using Crystal Report , How can we give the same password to Crystal Report 8.0
0
 

Author Comment

by:infoserver
ID: 7181682
if we are using Crystal Report , How can we give the same password to Crystal Report 8.0
0
 

Author Comment

by:infoserver
ID: 7181684
if we are using Crystal Report , How can we give the same password to Crystal Report 8.0
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8012056
Hi infoserver,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept hongjun's comment(s) as an answer.

infoserver, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8096007
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

730 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