Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6/MS Access/Password

Status
Not open for further replies.

JTA

Programmer
Mar 28, 2000
2
0
0
US
I am creating a VB6 application that will be distributed with an Access97 mdb. The database will not be written to in any way, simply looked at with a number of &quot;Select&quot; queries. I need to be able to prevent the mdb from being accessed outside of my program. If I password protect the mdb, can I somehow insert the password into the VB code, without any action on the part of the user? Preferably, the user wouldn't even be aware of the need for a password. <br>The idea is to limit the mdb access to a particular program (mine), not to a particular user. Any help would be greatly appreciated.
 
Yes, the password can be inserted into both the database and your VB code.<br> <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Any idea how/where I would go about inserting the VB code?<br>At the present I am only &quot;looking at&quot; the data via a<br>'Data1.RecordSource = &quot;Select * From....etc.&quot;<br><br>When I set a password for access, then run the program, the program halts with a msgbox reading &quot;Not a valid password&quot; right after running the query. This is with no password coding whatsoever. There's gotta be an easy way to do it, I'm certainly not the only one to have this requirement, but damned if I can find reference to it anywhere. Any ideas?<br><br>Thanks.
 
For an extensive tutorial How to do this and much more with databases. I usually go to <A HREF=" TARGET="_new"> tutorial #6 encompasses the question which you are asking.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;John Stephens
 
Private Sub Command1_Click()<br>Dim Db AS Dao.Database<br>Dim Password As String<br>Dim DbPath As string<br><br>Password=&quot;1111&quot;<br>DbPath=&quot;c:\Temp\Db1.mdb&quot;<br>Set Db=OpenDataBase(DbPath,True,False,&quot;;pwd=&quot; & Password) <br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top