Solved

Passing Access PW from VB5

Posted on 1998-08-31
5
228 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit a vb6 apps when a calling it apps closes 15 58
vbModal 12 66
Set email body to html using vbscript 6 71
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 38
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

733 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