LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Changing Query Source Location?

-----Original Message-----
Are you sure your query is named MyQuery?


Actually, my query has no name at all, so using the number
instead of the name worked much better. That at least
allowed me to get the connection string - which is one
step further than where I was before!

So.

Using some code Rob Rutherford gave me as a sample
earlier, I tried the following to reset the connection:

Function ChangePath()
Dim str As String
str = "ODBC;DSN=MS Access Database;DBQ="
str = str & "C:\Jennifer\ProjectOrganizer.mdb;"
ActiveSheet.QueryTables(1).Connection = str
End Function

This function compiles with no errors.

However, when I try to run it from the Immediate window, I
get this error:

"Compile error: Expected = "

And obviously, it doesn't update the connection.

I'm not sure where this should even be called, quite
frankly, or how to set it up.
 
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
link not updating after changing source location Fred Excel Discussion (Misc queries) 0 October 11th 07 06:05 PM
Changing query data source TonyL Excel Discussion (Misc queries) 1 July 4th 07 04:44 PM
changing query source [email protected] Excel Worksheet Functions 2 March 21st 06 08:55 PM
Changing Query source location? Jennifer Crawford Excel Programming 3 August 8th 03 11:37 PM
Query source location - how do I change? Jennifer Crawford Excel Programming 1 August 1st 03 09:14 AM


All times are GMT +1. The time now is 02:52 AM.

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"