PC Review


Reply
Thread Tools Rate Thread

Add password to querytable command

 
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      2nd Nov 2006
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.world;",
Destination:=Range("C4"))
.CommandText = Array


--
Richard
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      3rd Nov 2006
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" <(E-Mail Removed)> wrote in message
news:B28E21AD-595B-416E-94F4-(E-Mail Removed)...
> 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.world;",
> Destination:=Range("C4"))
> .CommandText = Array
>
>
> --
> Richard



 
Reply With Quote
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      3rd Nov 2006
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" <(E-Mail Removed)> wrote in message
> news:B28E21AD-595B-416E-94F4-(E-Mail Removed)...
> > 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.world;",
> > Destination:=Range("C4"))
> > .CommandText = Array
> >
> >
> > --
> > Richard

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
New QueryTable? =?Utf-8?B?TmVpbHk=?= Microsoft Excel Programming 1 8th Jun 2007 01:28 PM
web, querytable &jpg =?Utf-8?B?VG9tUg==?= Microsoft Excel Programming 0 4th Nov 2005 04:30 PM
Re: QueryTable's Dick Kusleika Microsoft Excel Programming 0 14th Aug 2004 02:50 AM
Querytable =?Utf-8?B?QmVuLmM=?= Microsoft Excel Programming 4 3rd Dec 2003 09:11 AM
QueryTable jp Microsoft Excel Discussion 0 25th Jul 2003 08:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:58 AM.