Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Changing a QueryTable data source

I've set up a QueryTable using "import external data". Works fine, except I
want to change my datasource. When you import, it pulls in your machine
name, hard coded database name, etc. I don't want that stuff. I want this
much

"ODBC;DSN=MyDB;Trusted_Connection=Yes"

Is there a way to change this from the UI? If not, a way to do it
programmatically?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Changing a QueryTable data source

Mike

You can change the Connection and CommandText properties of the QueryTable
object. I've never really done it from the import side, just the standard
query table so it may be slightly different. I'll be it's real similar to
this

http://www.dicks-clicks.com/excel/Ex....htm#ChangeSQL

Dick

Mike Jones wrote:
I've set up a QueryTable using "import external data". Works fine,
except I want to change my datasource. When you import, it pulls in
your machine name, hard coded database name, etc. I don't want that
stuff. I want this much

"ODBC;DSN=MyDB;Trusted_Connection=Yes"

Is there a way to change this from the UI? If not, a way to do it
programmatically?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Changing a QueryTable data source

What I'm seeing is that I can change it programmatically like this, but when
I save my XL spreadsheet, then reopen, its back to how it originally was;
with all the extra, unwanted stuff.

Strange.

"Dick Kusleika" wrote in message
...
Mike

You can change the Connection and CommandText properties of the QueryTable
object. I've never really done it from the import side, just the standard
query table so it may be slightly different. I'll be it's real similar to
this

http://www.dicks-clicks.com/excel/Ex....htm#ChangeSQL

Dick

Mike Jones wrote:
I've set up a QueryTable using "import external data". Works fine,
except I want to change my datasource. When you import, it pulls in
your machine name, hard coded database name, etc. I don't want that
stuff. I want this much

"ODBC;DSN=MyDB;Trusted_Connection=Yes"

Is there a way to change this from the UI? If not, a way to do it
programmatically?

Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Changing a QueryTable data source

Mike

Oh, I see. I don't think you can prevent Excel from doing what it wants to
your strings. If you describe your situation and why you want to do this,
maybe someone will have another way to accomplish it.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Mike Jones wrote:
What I'm seeing is that I can change it programmatically like this,
but when I save my XL spreadsheet, then reopen, its back to how it
originally was; with all the extra, unwanted stuff.

Strange.

"Dick Kusleika" wrote in message
...
Mike

You can change the Connection and CommandText properties of the
QueryTable object. I've never really done it from the import side,
just the standard query table so it may be slightly different. I'll
be it's real similar to this

http://www.dicks-clicks.com/excel/Ex....htm#ChangeSQL

Dick

Mike Jones wrote:
I've set up a QueryTable using "import external data". Works fine,
except I want to change my datasource. When you import, it pulls in
your machine name, hard coded database name, etc. I don't want that
stuff. I want this much

"ODBC;DSN=MyDB;Trusted_Connection=Yes"

Is there a way to change this from the UI? If not, a way to do it
programmatically?

Thanks



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
Changing Source Data using V-lookup Kevin Excel Worksheet Functions 2 April 14th 10 08:14 PM
Changing Data Source nathan_savidge Excel Worksheet Functions 1 July 17th 08 05:53 PM
Changing only source file of pre-existing text import QueryTable? EBrowne Excel Programming 3 August 23rd 04 03:31 AM
Changing Data Source Dave Excel Programming 4 June 22nd 04 04:31 PM
Changing Data Source Driver S Taylor Excel Programming 1 October 15th 03 03:04 PM


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