By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

Start Password Protected Ms Access MDB/MDE in Runtime

P: 10
Hi,
Please Please Please anyone out there, if you have a solution, i will highly appreciate as i have searched the internet for 5 days now with no hope.
1st, the versions i am using are Ms Access 2003 & Visual Studio 2005.
Problem
I am using a database password on my MDB (using "set database password"). This is just for my basic security to stop basic users from importing my queries (basic user, i know any advanced guy can hack in, but now that becomes a copyright issue). With this, i would like to use VB (.exe) to open the database without asking the user for the password. I have set up the Db so that the user does not have any control to reset the Db password, e.g. disabling shift overide, etc.
So far i have found two sets of code that still do not do what i want;
1.
Dim oAccess As Microsoft.Office.Interop.Access.Application
oAccess = New Microsoft.Office.Interop.Access.Application
oAccess.OpenCurrentDatabase(filepath:=Db_path, bstrPassword:="password")

This code works OK but opens the Db with the full version of access, not in the runtime version.....

2.
Shell(PathName:="""" & ms_access_path & """" & " " & """" & dbpath & """" & " /runtime")

This code opens the Ms Access DB in runtime but i cannot automatically enter the Db password......

What i need basically is to open my password protected MDB/MDE in /runtime without prompting for the password (password defined in the code of my .exe file)
Any assistance in solving this problem is much appreciated.
Oct 2 '07 #1
Share this Question
Share on Google+
8 Replies


slapshock
P: 57
Hi,
Please Please Please anyone out there, if you have a solution, i will highly appreciate as i have searched the internet for 5 days now with no hope.
1st, the versions i am using are Ms Access 2003 & Visual Studio 2005.
Problem
I am using a database password on my MDB (using "set database password"). This is just for my basic security to stop basic users from importing my queries (basic user, i know any advanced guy can hack in, but now that becomes a copyright issue). With this, i would like to use VB (.exe) to open the database without asking the user for the password. I have set up the Db so that the user does not have any control to reset the Db password, e.g. disabling shift overide, etc.
So far i have found two sets of code that still do not do what i want;
1.
Dim oAccess As Microsoft.Office.Interop.Access.Application
oAccess = New Microsoft.Office.Interop.Access.Application
oAccess.OpenCurrentDatabase(filepath:=Db_path, bstrPassword:="password")

This code works OK but opens the Db with the full version of access, not in the runtime version.....

2.
Shell(PathName:="""" & ms_access_path & """" & " " & """" & dbpath & """" & " /runtime")

This code opens the Ms Access DB in runtime but i cannot automatically enter the Db password......

What i need basically is to open my password protected MDB/MDE in /runtime without prompting for the password (password defined in the code of my .exe file)
Any assistance in solving this problem is much appreciated.

Try this code:


Dim cn As New ADODB.Connection
With cn
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=app.path & \yourdbasehere;jet oledb:database password=yourpasswordhere"
End With
Oct 3 '07 #2

jrtox
P: 89
Try this code:


Dim cn As New ADODB.Connection
With cn
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=app.path & \yourdbasehere;jet oledb:database password=yourpasswordhere"
End With

Hello,
Its my Problem also and I Got it Now.
Tnx

Regards
ervin
Oct 3 '07 #3

hariharanmca
100+
P: 1,977
Hi,
Please Please Please anyone out there, if you have a solution, i will highly.
Can you explain why you want open the DB File Exclusively?
Oct 3 '07 #4

jrtox
P: 89
Just wanna share my coding maybe it can help you out:
I do create i DB and Open it as Exclusively for me to put a SecurityPassword and my password is "0".

Now my coding in VB6 are as follow:

Function Connect()

Dim ESQL As String

Set CONN = New ADODB.Connection
Set CONN = Nothing

MSDatabase = App.Path & ("\DBase\TimeSheet.mdb")
CONN.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " & MSDatabase & ";jet oledb:database password=0"

End Function


Thank you Slapshock

Regards
Ervin
Oct 3 '07 #5

P: 10
Hi Guys,
Thanks for your assistance but this is not what i want.
I need to open the MDB application, not connect to it. The ADO code you provided just connects to the MDB.
Please go through my original post. My problem is opening the MDB database.
Oct 3 '07 #6

P: 10
Any one out thea who can help?????
Oct 4 '07 #7

P: 10
Anyone? HEEEEELP. Awaiting any response.
Oct 5 '07 #8

P: 2
Solved! Open the mdb exclusively using the /excl parameter in the shell command. Make sure shift-open is disabled in the mbd. Now dynamically link the backend only on startup of the frontend mdb. Now no one can get the the backend cause its got a plain old database pw on it, and its dynamically linked, and you can't shift-reenable it cause its exclusely opened. Please correct me if I'm wrong.
Jun 4 '13 #9

Post your reply

Sign in to post your reply or Sign up for a free account.