Solved

VBA Oracle Password Form and function to pass parameters

Posted on 2011-09-22
2
421 Views
Last Modified: 2012-06-21
I am trying to set up a MSAccess db with a function that collects and builds the ODBC connection to an Oracle db to run some sql and output a report.  I have all (what I thought were) the hard parts done.  Now I am building the security around the db.  

When the report is run and the function "strConnection"
that builds the connection is called up, I want a popup password form to open (frmEnterACSPswd).  The user enters their password, clicks the "Enter" button, and the password is passed to the function "strConnection" and the oracle db is called up and passed the parameters to log in.

Function strConnection(strServerName As String, strHost As String, lngPort As Long, strUserId As String, strPassWord As String) As String
I'm drawing a blank on how best to pass the password parameter to the function strConnection.  I think I am making this way harder than it should be.  Any suggestions would
be appreciated.

Thanks, Lynn
 
0
Comment
Question by:Lambel
2 Comments
 
LVL 13

Accepted Solution

by:
khairil earned 500 total points
ID: 36585055
Hi,

I assume you have created the form that use to log user in. From that form just pass the userID and password only to the function. You do not need to have connection string return to you, just declare ADO connection object as public and make that ADO connection to open the string to you.

By making that ADO connection object  as public you will be able to access it everywhere from your VBA code. If you like to protect the VBA code then you should explorer this, http://msdn.microsoft.com/en-us/library/aa139961(v=office.10).aspx and this, http://msdn.microsoft.com/en-us/library/aa200349(v=office.11).aspx
0
 

Author Closing Comment

by:Lambel
ID: 36587834
Thank you for the suggestion, that's all I needed to finish it up.  And thank you for the information links.
Lynn
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now