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

I created an Excel file that queries an Access database that is
password protected. The
file has multiple pivot tables that have SQL connection to the
database.

When I try to refresh these pivot tables I get a dialog box asking me
to provide authorization to the data
source (Login name is supplied, password is not). If I were the only
user I would consider this an unfortunate inconvenience, but I created
this Excel file to allow other users to access data in specific tables
and not have access to the whole database. Excel asking for a
password pretty much kills the purpose of the file.

Is there an elegant way to put this password into the Connection?

Terry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Database Connection Password

Just a follow-up to anyone in future who has a similar question.
You can go into the properties of the database connection and save the
password.
In Excel 2007: Data Ribbon -- Connections Group -- Properties.
From that dialog box, click on Definitions and click Save Password.

In VBA:

Sub Initialize()
Dim CNN As WorkbookConnection
'...
'... (lots of code setting up the pivot tables)
'...
For Each CNN In ActiveWorkbook.Connections
CNN.ODBCConnection.SavePassword = True
Next CNN
End Sub
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 connection dsn vs. odc alex Excel Programming 2 June 3rd 08 04:50 PM
Database Connection srikanth Excel Programming 1 February 6th 07 11:39 PM
Database Connection Phil Excel Programming 1 September 30th 05 12:25 PM
Database Connection Jake Marx[_3_] Excel Programming 0 July 1st 05 03:50 PM
DataBase Connection willie[_2_] Excel Programming 0 January 27th 04 10:06 PM


All times are GMT +1. The time now is 11:35 PM.

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

About Us

"It's about Microsoft Excel"