Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete external data query

Hi -
My spreadsheet has a link to a SQL Server View. Created by Data/Import
External Data/ New Database Query.
I want to change the spreadsheet to access a different View. I have gone to
Edit Query and tried to find a way to either remove the link to the View or
access the new View but I can't seem to find what I need to do. I appreciate
any help from someone more knowledgeable that I.
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default delete external data query

You have to change the query's Connection property. To find out what it is,
add a line in your code to display it in the Debug window:

Debug.Print <querytable_object.Connection

Make that line a breakpoint, run your code, and hit F8 when it break. Then
open the Immediate window (Ctrl-G in the VBE), and somewhere you'll see the
name of the view you originally used.

To get data from another view, you'll probably need code like this:

With <querytable_object
.Connection = Replace$(.Connection, "OldViewName", "NewViewName")
.Refresh
End With

--
* Please click Yes if this was helpful *
Andy Smith
Senior Systems Analyst
Standard & Poor''s, NYC



"Mark C." wrote:

Hi -
My spreadsheet has a link to a SQL Server View. Created by Data/Import
External Data/ New Database Query.
I want to change the spreadsheet to access a different View. I have gone to
Edit Query and tried to find a way to either remove the link to the View or
access the new View but I can't seem to find what I need to do. I appreciate
any help from someone more knowledgeable that I.
Thank you.

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
query to external data Tony7659 Excel Programming 3 September 4th 09 12:23 AM
External Data Query Marie Bayes Excel Discussion (Misc queries) 4 January 11th 07 06:08 PM
Get External Data-New Web Query saziz Excel Discussion (Misc queries) 1 May 23rd 06 10:22 PM
External Data Query WhytheQ Excel Programming 2 May 5th 06 04:57 PM
Query of External Data Excel GuRu Excel Discussion (Misc queries) 2 January 3rd 05 07:43 PM


All times are GMT +1. The time now is 07:19 AM.

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"