Solved

VBA Oracle Password Form and function to pass parameters

Posted on 2011-09-22
2
419 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to recover a database from a user managed backup

747 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

13 Experts available now in Live!

Get 1:1 Help Now