473,395 Members | 1,568 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,395 software developers and data experts.

open encrypted database programatically

n8kindt
221 100+
i'm trying to create a secure scenario where no one will be able to know our encrypted database passcode. BUT if they login to a form in another database successfully, it will open the encrypted database and systematically plug in the passcode thru vba (kind of like a user on a website logging into a secure SQL database i suppose). i may be going about this whole situation completely wrong but here is what i have for the code that i need to create to open the encrypted database.

Expand|Select|Wrap|Line Numbers
  1. Dim appAccess As Access.Application
  2.  
  3. Sub DisplayForm()
  4. On Error GoTo errorhandler
  5.     Dim strDB As String
  6.     Dim Password As String
  7.     Password = gg123
  8.  
  9.     ' Initialize string to database path.
  10.     Const strConPathToSamples = "\\ggserver\SharedDocs\Access DB\"
  11.  
  12.     strDB = strConPathToSamples & "encryptedtest.accdb"
  13.     ' Create new instance of Microsoft Access.
  14.  
  15.     Set appAccess = CreateObject("Access.Application")
  16.     ' Open database in Microsoft Access window.
  17.  
  18.  
  19.     appAccess.OpenCurrentDatabase strDB, "false", Password
  20.  
  21.  
  22.  
  23. End Sub
unfortunately, the "enter database password" still pops up when the new database opens and i have to type in the password TWICE. if i type in an incorrect password, the original code bounces back and gives me error #3031: "Not a valid password." i'm starting to wonder if by password, access means the old passwords used in access 2003 and earlier and the OpenCurrentDatabase function has nothing to do with encrypted databases. i have access 2007 and there are no such logins like that--just encrypted passwords.

so if anyone has any idea why this code is not working correctly or what an alternative might be then please let me know! thanks guys

--nate
Jun 9 '08 #1
4 6869
n8kindt
221 100+
LOL i am still googling for the answer and i got all excited when google found a thread in bytes.com entitled "open encrypted database programatically" but when i clicked on it i realized it was my own post! LOL still could use some help on this one!! thanks!!
Jun 11 '08 #2
n8kindt
221 100+
figured it out myself! i didn't have any business stumbling into the answer but i got lucky. here's the new code:

Expand|Select|Wrap|Line Numbers
  1. Sub DisplayForm()
  2. 'On Error GoTo errorhandler
  3.     Dim strDB As String
  4.     Dim Password As String
  5.     Password = gg123
  6.  
  7.  
  8.  
  9.  
  10.  
  11.     ' Initialize string to database path.
  12.     Const strConPathToSamples = "\\ggserver\SharedDocs\Access DB\"
  13.  
  14.     strDB = strConPathToSamples & "encryptedtest.accde"
  15.     ' Create new instance of Microsoft Access.
  16.  
  17.     Set appAccess = CreateObject("Access.Application")
  18.     ' Open database in Microsoft Access window.
  19.     appAccess.Visible = True
  20.     appAccess.UserControl = True
  21.     appAccess.AutomationSecurity = 1 ' = msoAutomationSecurityLow
  22.     appAccess.OpenCurrentDatabase "\\ggserver\shareddocs\access DB\encryptedtest.accde", False, "gg123"
  23.     Set appAccess = Nothing
  24.  
  25.  
  26.  
  27. Exit Sub
Jun 11 '08 #3
May God personnaly bless you. You solved my tomorrow problem yesterday.
Jun 7 '11 #4
NeoPa
32,556 Expert Mod 16PB
I would suggest that is a highly doubtful approach to Access security - Turning it off (or down) to get past it is dodgy enough on your own systems, but if it were to run on someone else's you may be liable to being sued for damages if they were to allow some other dodgy code to run because your code had reduced the security level. That could be a serious responsibility.
Jun 13 '11 #5

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

Similar topics

10
by: sffan | last post by:
I am new to database programming and was curious how others solve the problem of storing encrypted in data in db table columns and then subsequently searching for these records. The particular...
6
by: Ian Davies | last post by:
Hello I would like to query the user table of the mysql database from my VB application to check that a user's password entered in a text field on a form corresponds to that users password in the...
5
by: Nico | last post by:
My database have 20 tables and many users. I wish to store encrypted data in 3 tables and have only 3 users have access to them, walking into tables or using forms. Can someone point me a direct...
1
by: Martin | last post by:
Is there a way to create and encrypted database file? What do people do when data security is important at the file level? In other words, you don't want anyone to be able to take the database...
7
by: Brian Parker | last post by:
I'm reading PDF files in C#. I read them in using a TextReader then I parse out the pieces I want like the CreationDate, Author, etc. Sometimes, the PDF file is encrypted and I get binary junk...
5
by: Ranginald | last post by:
Hi, I have a question about encrypting connection strings in an asp.net 2.0 app in a shared hosting environment. From what I have read, I believe I need to programatically encrypt and decrypt...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
5
by: Shmuel | last post by:
Hello, Is it possible to give to mysql_connect an encrypted (md5 or sha1) password? If not is there a workaround? I store passwords for users in database and don't want to use plain text...
1
by: Brian Stoop | last post by:
Can RDP password be written programatically, is there a dll that contains a method for generating encrypted passwords? thanks
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.