Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Database Query Password

In my workbooks I often use one sheet to contain multiple database
queries from separate tables for lists of Department Id's, Account
Numbers, Project Id's, etc. I then assign names to the ranges and then
use these named ranges in validated cells. For each of the queries I set
the data range properties to refresh data on file open.

My problem is that I need to have the user who opens the file enter
their name and password so the lists are validated using the database
security to display only the Id's they are allowed to view and use. I
can set the data range properties to not save the password, however, if
there are multiple queries they are forced to re-enter their name and
password once for each query.

Using VBA, can I request a username and password, with the password
displayed as *** as they type it in, then apply this into each query as
I refresh them using VBA rather than refreshing the data on file open?

I would set this procedure to run in my Workbook_open() sub



Simon Shaw, CA
Parnter
AccountTech
www.accounttech.ca

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Database Query Password

Couldn't you carry the uid and pwd as a variable and then
pass it each time in the connection string?

This would be similar to holding it as a session variable
on a web site.
-----Original Message-----
In my workbooks I often use one sheet to contain multiple

database
queries from separate tables for lists of Department

Id's, Account
Numbers, Project Id's, etc. I then assign names to the

ranges and then
use these named ranges in validated cells. For each of

the queries I set
the data range properties to refresh data on file open.

My problem is that I need to have the user who opens the

file enter
their name and password so the lists are validated using

the database
security to display only the Id's they are allowed to

view and use. I
can set the data range properties to not save the

password, however, if
there are multiple queries they are forced to re-enter

their name and
password once for each query.

Using VBA, can I request a username and password, with

the password
displayed as *** as they type it in, then apply this into

each query as
I refresh them using VBA rather than refreshing the data

on file open?

I would set this procedure to run in my Workbook_open()

sub



Simon Shaw, CA
Parnter
AccountTech
www.accounttech.ca

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Database Query Password

Hi Simon,

In VBA project, we can add a userform and two textboxs and a button onto
the userform.
TextBox1: UserName
TextBox2: Password,we can set the textbox's PasswordChar property to "*",
so that when user inputed, the character will be *****.

And in the Button click event, we can get the Textboxs' values and build it
into the connectionstring to do the query. We can popup the userform1
whenever we wants user to input username and password by call the
userform1.show.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Database Query Password

Hi Simon,

Have you tried my suggestion?
If you still have any concern on this issue, please feel free to post here
and I will work on it with you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 1 November 29th 05 01:44 PM
Excel 2000 required username and password login for database query ISTech Setting up and Configuration of Excel 0 September 7th 05 01:11 AM
Required multiple user name and password logins for database query ISTech Excel Discussion (Misc queries) 0 August 22nd 05 09:53 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"