WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Requery issue when moving master file to other PC

 
   Home -> Office -> Query DAO RSS
Next:  Query DAO: Internet - Take Advantage of Multiple Windows When Surfing  
Author Message
Mark Ivey

External


Since: Mar 05, 2008
Posts: 13



(Msg. 1) Posted: Tue Apr 22, 2008 6:46 am
Post subject: Requery issue when moving master file to other PC Add to elertz
Archived from groups: microsoft>public>excel>querydao (more info?)

I am having an issue with a requery from my master file when I try to use it
on other PCs at my workplace.

I went into the Edit Query mode and attempted to change the path for my data
file, but I am getting the following message [Microsoft][ODBC Excel Driver]
and then the file path is an invalid path.

Has anyone experienced an issue like this before?

Can anyone offer a suggestion?

Mark Ivey
Back to top
Login to vote
Bill Manville

External


Since: Jul 30, 2004
Posts: 751



(Msg. 2) Posted: Sat Apr 26, 2008 10:59 pm
Post subject: Re: Requery issue when moving master file to other PC Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sorry no-one got back to you sooner.

MSQuery has an annoying habit of including the path to the datasource
in the SQL of the query. Like
SELECT MyField FROM `C:\MyDir\MySubDir\MyFile.mdb`.MyTable MyTable
when
SELECT MyField FROM MyTable
would suffice, since the Connection parameter defines the location of
the datasource.

So you have to persuade it to change the SQL as well as the Connection
parameter of the QueryTable.

There are a number of ways you could go about programatically changing
the SQL and Connection properties to address the file correctly.
My preference is to create the query, put the cursor in the result area
and in the VB editor immediate window do
?ActiveCell.QueryTable.SQL
and
?ActiveCell.QueryTable.Connection

Then I write code that sets the SQL and Connection correctly to where
the source file will be found (often relative to ThisWorkbook.Path)

Bill Manville
MVP - Microsoft Excel, Oxford, England
Back to top
Login to vote
Mark Ivey

External


Since: Apr 26, 2008
Posts: 3



(Msg. 3) Posted: Sat Apr 26, 2008 10:59 pm
Post subject: Re: Requery issue when moving master file to other PC Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Many thanks for the response and information...

It may be a day or two before I can test this information, but I will let
you know the results either way...

Mark Ivey



"Bill Manville" <Bill-Manville DeleteThis @msn.com> wrote in message
news:VA.00001497.13081b27@msn.com...
> Sorry no-one got back to you sooner.
>
> MSQuery has an annoying habit of including the path to the datasource
> in the SQL of the query. Like
> SELECT MyField FROM `C:\MyDir\MySubDir\MyFile.mdb`.MyTable MyTable
> when
> SELECT MyField FROM MyTable
> would suffice, since the Connection parameter defines the location of
> the datasource.
>
> So you have to persuade it to change the SQL as well as the Connection
> parameter of the QueryTable.
>
> There are a number of ways you could go about programatically changing
> the SQL and Connection properties to address the file correctly.
> My preference is to create the query, put the cursor in the result area
> and in the VB editor immediate window do
> ?ActiveCell.QueryTable.SQL
> and
> ?ActiveCell.QueryTable.Connection
>
> Then I write code that sets the SQL and Connection correctly to where
> the source file will be found (often relative to ThisWorkbook.Path)
>
> Bill Manville
> MVP - Microsoft Excel, Oxford, England
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Query DAO All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET