PC Review


Reply
Thread Tools Rate Thread

Change Destination Table in QBE from VBA

 
 
Guest
Posts: n/a
 
      1st Jul 2004
I have a QBE that is a make table query and it makes a
table in an external database. I want to be able to use a
parameter to supply the destination database name. I do
not want to use a sql string but rather want to use the
following code - DoCmd.OpenQuery "myQuery" - without
defining a QueryDEF or creating the query.

For some reason the query runs faster if I do not use a
QueryDEF or try to execute a SQL String. I have performed
multiple test and cannot figure out why (but that is
another issue).



Regards,
JohnV
 
Reply With Quote
 
 
 
 
Geoff
Guest
Posts: n/a
 
      4th Jul 2004
John,

Could it be, in your case, that the saved query executes
more quickly because Access transparently saves an
execution plan with saved queries?

I don't know how you can achieve your objective without
recreating the query or SQL in code - in which case,
as you seem to have found, it will run more slowly. Usually,
the only parameters you'd pass to a query are values to
complete a query's criteria. You want to fundamentally
change the action of the query, which I think means you
will need to re-create it or re-create an SQL, substituting
a variable for the destination table name in the SQL string.
I've never tried that for an external database, but I imagine
it's possible.

Geoff


 
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
Make-Table Destination Table Name djdever Microsoft Access Queries 1 19th Jun 2008 04:04 PM
Change linked table destination--Access Link to SQL 2005 =?Utf-8?B?Q2hyaXN0JydzY2hpbGQ=?= Microsoft Access VBA Modules 1 5th Mar 2007 11:46 AM
How to Update a Destination Table using a Source Table using VBS Carlos Garcia via AccessMonster.com Microsoft Access External Data 2 12th Apr 2005 07:19 PM
Programmatically change the destination of a link table Hai Ly Hoang Microsoft Access 1 18th Dec 2004 11:08 AM
How to change destination table in VBA Dan Microsoft Access Queries 1 5th Feb 2004 11:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 PM.