Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA Oracle Password Form and function to pass parameters

Posted on 2011-09-22
2
Medium Priority
?
438 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

885 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