473,757 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open encrypted database programatically

n8kindt
221 New Member
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 OpenCurrentData base 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 6900
n8kindt
221 New Member
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 New Member
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
danisoje
1 New Member
May God personnaly bless you. You solved my tomorrow problem yesterday.
Jun 7 '11 #4
NeoPa
32,572 Recognized Expert Moderator MVP
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
5487
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 problem that I am facing is in dealing with (privacy) critical information like credit-card #s and SSNs or business critical information like sales opportunity size or revenue in the database. The requirement is that this data be stored encrypted...
6
7522
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 mysql database. However, when I retreive the password using an sql statement into a recordset, it is encrypted. How can I decrypt it so I can make the comparison. Ian
5
2263
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 help or something to read? Tnx Nico
1
1731
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 file (or files) and extract data from them. Ideally, I want a file the is absolutely encrypted on disk and that is decrypted for data access. The problem, obviously, is that this would be a very costly (cpu time) approach as you couldn't create...
7
8267
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 in my parsed strings. Is there a real simple way to determine that a PDF file is using encryption besides checking if the individual pieces of data have binary junk in them? -BEP
5
2452
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 the conn string because I do not have access to run aspnet_regiis on the remote machine. My question is where to do I put the code? Do I first encrypt the connection string on page_load, and then every time I need to access the database decrypt...
2
7692
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 message digest. " and also explains how the length of the encrypted column can be derived.
5
6098
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 passwords. Then I use that information to connect to the database. So every user have his own database.
1
3356
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
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9735
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.