Solved

Passing Access PW from VB5

Posted on 1998-08-31
5
230 Views
Last Modified: 2010-04-30
What property do I set in a VB5 data control to supply an Access database with a password (so I may get to the database fields)?

Thank you in advance.
0
Comment
Question by:tisd
[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
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
chewhoung earned 20 total points
ID: 1432051
There is no property to set password for Access db On VB5 data control. You need to disable the password on Access db to get in the fields. Once, you have done your coding(completely), set back your password onto Access db. To use your VB5 application on a secure Access db, you need to let user key in user id and password at entry of your VB5 application.
To verify user id and password in VB5, put the following code in your VB5 application logon screen:

   DBEngine.SystemDB = "C:\yoursystemmdw.mdw"

   'Create a new workspace object
   'gwWorkSpace is a Global variable where you put in the module
   'txtUserName and txtPassword are fields on Logon screen.
   '
   Set gwWorkSpace = DBEngine.CreateWorkspace("New", _
   Trim(txtUserName.Text), Trim(txtPassword.Text), dbUseJet)

0
 

Author Comment

by:tisd
ID: 1432052
Regarding   DBEngine.SystemDB = "C:\yoursystemmdw.mdw",

what is "C:\yoursystemmdw.mdw" ?

Thank you..
0
 
LVL 5

Expert Comment

by:chewhoung
ID: 1432053
For a protected Access db, you should have already created a system.mdw file(assuming you are using Access97, system.mda for Access 2.0).

For example:
you have a mdb call inventory.mdb in c:\inventory directory.
you should put your system.mdw in the same directory.
so, C:\yoursystemmdw.mdw = C:\inventory\system.mdw.
0
 

Author Comment

by:tisd
ID: 1432054
Dear Sir/Madam;

I have searched my entire disk for a .mdw or .mda file.  None exists.  How do I create this file so I may test the solution you have provided?

Thanks in advance.
0
 
LVL 5

Expert Comment

by:chewhoung
ID: 1432055
Couldn't find??
I thought your access database is secured??
You cannot secured an access database without a workgroup file.
By default, Access97 create a workgroup file under
windows->system directory.
Tell me something, when you double click your Access mdb file from explorer, did Access prompt you for password?
If it doesn't, your mdb file is not secured and you should be able to get the fields for tables in your VB5 application.

To create a new workgroup file:
I assumed you are using Access97 from Office97.
Go to the Office directory, look for a shortcut call MS Access WorkGroup Administrator or use explorer go to windows->system directory and run the file call WRKGADM.EXE.
Click Create button to create a new workgroup file (mdw) under your application's directory.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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