Solved

VBA Oracle Password Form and function to pass parameters

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Suggested Courses

628 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