Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBA Oracle Password Form and function to pass parameters

Posted on 2011-09-22
2
Medium Priority
?
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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 …
Suggested Courses

730 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