Replace a query

  • Thread starter Thread starter ChoonBoy
  • Start date Start date
C

ChoonBoy

How can I replace a query in another database.mde?

I have in C:/Test/database.mde

I want to replace a query "qSales" in database.mde from another mdb or mde.

I am thinking along this line

Click button - "qSales" is removed and new "qSales" is replaced.

Thanks in advance.
 
ChoonBoy said:
How can I replace a query in another database.mde?

I have in C:/Test/database.mde

I want to replace a query "qSales" in database.mde from another mdb or
mde.

I am thinking along this line

Click button - "qSales" is removed and new "qSales" is replaced.


I have to differ with those who have posted saying you can't do this. While
you can't change the design of forms, reports, or modules in an MDE, you can
change tables and queries. Suppose you have a database you're running this
update from, and that database has a query "qSales" that you want to replace
the like-named query in "C:/Test/database.mde". This line of code will do
it:

DoCmd.TransferDatabase acExport, _
"Microsoft Access", "C:/Test/database.mde", _
acQuery, "qSales", "qSales"
 
Linq said:
You cannot make design changes to mde files. To change this you have
to have access to the original mdb file.

Incorrect. Nothing about an MDE affects queries or tables. The existing
query could be changed or a new one imported to replace it or exported from
another file.
 
Thanks, I will test this out.


Dirk Goldgar said:
I have to differ with those who have posted saying you can't do this. While
you can't change the design of forms, reports, or modules in an MDE, you can
change tables and queries. Suppose you have a database you're running this
update from, and that database has a query "qSales" that you want to replace
the like-named query in "C:/Test/database.mde". This line of code will do
it:

DoCmd.TransferDatabase acExport, _
"Microsoft Access", "C:/Test/database.mde", _
acQuery, "qSales", "qSales"


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
From another DB.mde.

The objective is to replace a query with an updated query.

Can anyone please help me with the close database.mde codes before the
replace query code is run.

Thanks


bhicks11 via AccessMonster.com said:
Interesting - where are you running that export from?

Bonnie

Dirk said:
How can I replace a query in another database.mde?
[quoted text clipped - 6 lines]
Click button - "qSales" is removed and new "qSales" is replaced.

I have to differ with those who have posted saying you can't do this. While
you can't change the design of forms, reports, or modules in an MDE, you can
change tables and queries. Suppose you have a database you're running this
update from, and that database has a query "qSales" that you want to replace
the like-named query in "C:/Test/database.mde". This line of code will do
it:

DoCmd.TransferDatabase acExport, _
"Microsoft Access", "C:/Test/database.mde", _
acQuery, "qSales", "qSales"
 
bhicks11 via AccessMonster.com said:
I guess that's why I'm puzzled. You can hit the tables but you can't
modify
an mde.


Yes, you can. You can modify the design of tables and queries in an MDE.
 
Back
Top