473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Start Password Protected Ms Access MDB/MDE in Runtime

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
8 4838
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
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
1,977 1GB
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
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
gngui
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
gngui
10
Any one out thea who can help?????
Oct 4 '07 #7
gngui
10
Anyone? HEEEEELP. Awaiting any response.
Oct 5 '07 #8
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

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

Similar topics

0
by: Ben Reese | last post by:
Hi this is a general windows question as much as .net. I need to connect to a directory on a UNC path that is on same WAN but a different domain to the application. The directory is protected by...
4
by: Kelly Bowles | last post by:
I have made a purchase requistion which I have been asked to put password protected copy of requestors signature. I am thinking that each signature will have to be scanned as a picture and linked...
3
by: Anita Mossey | last post by:
Is there a way to automatically retrieve passwords with VBA, preferably with ADO as opposed to DAO?
3
by: MissiMaths | last post by:
I have used outputTo to export a copy of a table out of access into excel. I was wondering if there is anyway to set a password on this within the code so that it is read only in .xls format? I...
12
by: GTi | last post by:
I have small program that always must be running when a user is logged on. Since users can close this program I must create a program that always check if this program is running. So I created a...
7
by: Stanav | last post by:
Hello all, I'm writing a program that interacts with databases. I want that when the users run this program, they can view the data as much as they want. But if they make any changes to the data...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
3
by: Miro | last post by:
Why Password protect an MDB when someone can google and get a hack? Wondering if anyone else has thought of this and just said "oh well"... I plan to password protect an MDB where I have some...
3
by: -xx- | last post by:
Hi, I am new to c# and just trying out c# with ms access. First problem i encountered is how do i open up ms access that has password. Here is my current codes which working fine if there is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.