Solved

Passing Access PW from VB5

Posted on 1998-08-31
5
225 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
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
chewhoung earned 20 total points
Comment Utility
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
Comment Utility
Regarding   DBEngine.SystemDB = "C:\yoursystemmdw.mdw",

what is "C:\yoursystemmdw.mdw" ?

Thank you..
0
 
LVL 5

Expert Comment

by:chewhoung
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now