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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Access 2003 database using VB code (exe file)

Status
Not open for further replies.

ishfady

Programmer
Sep 14, 2002
31
GB
Hi

I have a Access 2003 database (mdb file). This database use mdw file for security. User enter name and password to access this database.

I would like write vb code to open this access database.
All User will have to do is click exe file to open database.

Is this possible with Visual Basic.

Please could you help me.

Many thank
 
If you are hoping to be able to completely bypass the Access security system by using VB then you will be disappointed.

You can access the database from VB but you will need to set up an ADO Connection string that includes the reference to the mdw file (the System database) as well as providing a valid username and password. If these are built into the VB application then there will be no apparent difficulty in opening the database but you will have compromised the security that was presumably put there to guard against anybody being able to access the data.





Bob Boffin
 
Do you have a sample of the string and the code that executes it? I want to open a mdb that does not have any passwords tied to it.

Thanks
 
Here is an example:

DBNAME = "mynewdb.mdb"
gsDatabase = DBPATH & DBNAME
gsmdw = App.Path & "\sasssdbf\" & "MedAudit.mdw"
If nuevosistema Then
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & gsDatabase & ";" _
& "Jet OLEDB:System Database=" & gsmdw & _
"; User Id=jmuniz;Password=micatriste;" & _
"Jet OLEDB:Database Password=micatriste;"
Else
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & gsDatabase & ";" _
& "Persist Security Info=False"

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top