ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refresh Query table using own password for each username (https://www.excelbanter.com/excel-programming/352518-refresh-query-table-using-own-password-each-username.html)

kuh

refresh Query table using own password for each username
 

Please help me. I have many query table using data source : ODBC and
driver : Oracle. I want to refresh the table using own password for
each username. How to add my macro for doing that?
It's my macro :

Code:
--------------------
Sub refresh1()
With Sheets("Data").Range("B5")
.QueryTable.Refresh BackgroundQuery:=False
End With
End Sub
--------------------


thanks very much.


--
kuh
------------------------------------------------------------------------
kuh's Profile: http://www.excelforum.com/member.php...o&userid=31224
View this thread: http://www.excelforum.com/showthread...hreadid=508948


K Dales[_2_]

refresh Query table using own password for each username
 
If you set the querytable properties (right-click on the query data range and
choose "Properties...") you can tell it to remember the password. Or, you
can have your macro edit the QueryTable.Connection property, which has the
connection string; this normally contains the user ID (UID) and password
(PWD); however be advised that with either of these approaches anyone with a
knowledge of VBA could potentially discover your user id and password by
examining the connection string. If security is an issue you should perhaps
set up a different account on the database giving access to only the queries
you need your users to run and use that account rather than your own!
--
- K Dales


"kuh" wrote:


Please help me. I have many query table using data source : ODBC and
driver : Oracle. I want to refresh the table using own password for
each username. How to add my macro for doing that?
It's my macro :

Code:
--------------------
Sub refresh1()
With Sheets("Data").Range("B5")
.QueryTable.Refresh BackgroundQuery:=False
End With
End Sub
--------------------


thanks very much.


--
kuh
------------------------------------------------------------------------
kuh's Profile: http://www.excelforum.com/member.php...o&userid=31224
View this thread: http://www.excelforum.com/showthread...hreadid=508948



Rob van Gelder[_4_]

refresh Query table using own password for each username
 
Instead of configuring an ODBC connection on the Machine tab try configuring
an ODBC connection on the User tab.

If you are using Oracle integrated security, then the username is a
forward-slash.

While experimenting, you may find my Query Editor add-in useful - available
on my website.

--
Rob van Gelder - http://www.vangelder.co.nz/


"kuh" wrote in message
...

Please help me. I have many query table using data source : ODBC and
driver : Oracle. I want to refresh the table using own password for
each username. How to add my macro for doing that?
It's my macro :

Code:
--------------------
Sub refresh1()
With Sheets("Data").Range("B5")
.QueryTable.Refresh BackgroundQuery:=False
End With
End Sub
--------------------


thanks very much.


--
kuh
------------------------------------------------------------------------
kuh's Profile:
http://www.excelforum.com/member.php...o&userid=31224
View this thread: http://www.excelforum.com/showthread...hreadid=508948





All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com