Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Add password to querytable command

How can I reformat following command to add the password, so I don't have to
type password every time I run macro

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=CEFMS;UID=u4rf9rmd;SERVER=cefms.worl d;",
Destination:=Range("C4"))
.CommandText = Array


--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Add password to querytable command

Richard,
I find the easiest way to create connection strings is :
- create a new text file somewhere suitable
- rename it "ConnStr.udl"
- double click
- follow the step filling the relevant info
- OK
- Open the file a text editor
- Copy the text

NickHK

"Richard" wrote in message
...
How can I reformat following command to add the password, so I don't have

to
type password every time I run macro

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=CEFMS;UID=u4rf9rmd;SERVER=cefms.worl d;",
Destination:=Range("C4"))
.CommandText = Array


--
Richard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Add password to querytable command

Brilliant. I would never have though of that in a million years.

However, where do I put this new text into my old ActiveSheet.QueryTables
command?
I tried replacing the part in between the quotes
(i.e. ODBC;DSN=CEFMS;UID=u4rf9rmd;SERVER=cefms.world;)
but get this error:
Compile error: Expected: list separator or )
and it highlights my password. Could this error be tied to the fact that my
password contaings an underscore "_" similar to the symbol for a continuation
line in VBS?

--
Richard


"NickHK" wrote:

Richard,
I find the easiest way to create connection strings is :
- create a new text file somewhere suitable
- rename it "ConnStr.udl"
- double click
- follow the step filling the relevant info
- OK
- Open the file a text editor
- Copy the text

NickHK

"Richard" wrote in message
...
How can I reformat following command to add the password, so I don't have

to
type password every time I run macro

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=CEFMS;UID=u4rf9rmd;SERVER=cefms.worl d;",
Destination:=Range("C4"))
.CommandText = Array


--
Richard




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
password protect unhide sheet command jimmill Excel Discussion (Misc queries) 1 February 24th 09 10:08 PM
how can I assign a password to a command button Help! Excel Programming 2 January 4th 06 01:52 PM
web, querytable &jpg TomR Excel Programming 0 November 4th 05 04:30 PM
Command Button Password Cindy Excel Programming 3 January 14th 04 04:32 PM
Password feature in command buttons Marvin Moore Excel Programming 1 September 10th 03 09:25 AM


All times are GMT +1. The time now is 07:34 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"