UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Syntax For Triggering An Update Query In Another Database Using Tables In The Other Database    
 
   
a5tell
post May 5 2012, 06:21 AM
Post #1

New Member
Posts: 2



Hi all

Need some help so hoping there's an easy answer.

Background: I have a database from which I'm creating a temp database that's intended to be used to hold some temp tables while the data is used to build a master table that's re-imported back into the database. All this to avoid bloating of the actual database. I've managed to create the db and put in the base table and the first temp table. What I need to do now is have a query run that uses the temp table in the temp db update the base table in the temp db but execute from the "real" database.

The update query, if I built it in the temp db would be:

UPDATE tmp_tblDeckTaxes

INNER JOIN tmp_tbldecktaxes_1
ON (tmp_tblDeckTaxes.Ent_ID = tmp_tbldecktaxes_1.Ent_ID)
AND (tmp_tblDeckTaxes.Loc_ID = tmp_tbldecktaxes_1.Loc_ID)
AND (tmp_tblDeckTaxes.Country = tmp_tbldecktaxes_1.Country)
AND (tmp_tblDeckTaxes.Rpt_ID = tmp_tbldecktaxes_1.Rpt_ID)
AND (tmp_tblDeckTaxes.Rule = tmp_tbldecktaxes_1.Rule)

SET tmp_tblDeckTaxes.Tax1_Juris = [tmp_tbldecktaxes_1].[Tax1_Juris],
tmp_tblDeckTaxes.Tax1_Name = [tmp_tbldecktaxes_1].[Tax1_Name],
tmp_tblDeckTaxes.Tax1_Reg = [tmp_tbldecktaxes_1].[Tax1_Reg],
tmp_tblDeckTaxes.Tax1_Tx = [tmp_tbldecktaxes_1].[Tax1_Tx],
tmp_tblDeckTaxes.Tax1_Rate = [tmp_tbldecktaxes_1].[Tax1_Rate];


What I'm trying to do is something like the following but I don't know the syntax to get this to fly:

UPDATE [C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb].tmp_tblDeckTaxes_1
IN 'C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb'

INNER JOIN [C:\Users\RC02041\Desktop\ASWorkDisc1\T-Rx-v\TRxTemp.accdb].tmp_tblDeckTaxes

ON (tmp_tblDeckTaxes1.Ent_ID = tblDeckTaxes.Ent_ID)
AND (tmp_tblDeckTaxes1.Loc_ID = tblDeckTaxes.Loc_ID)
AND (tmp_tblDeckTaxes1.Country = tblDeckTaxes.Country)
AND (tmp_tblDeckTaxes1.Rpt_ID = tblDeckTaxes.Rpt_ID)
AND (tmp_tblDeckTaxes1.Rule = tblDeckTaxes.Rule)

SET tblDeckTaxes.Tax1_Juris = [tmp_tblDeckTaxes1].[Tax1_Juris],
tblDeckTaxes.Tax1_Name = [tmp_tblDeckTaxes1].[Tax1_Name],
tblDeckTaxes.Tax1_Reg = [tmp_tblDeckTaxes1].[Tax1_Reg],
tblDeckTaxes.Tax1_Tx = [tmp_tblDeckTaxes1].[Tax1_Tx],
tblDeckTaxes.Tax1_rate = [tmp_tblDeckTaxes1].[Tax1_rate]


(This is in a loop so there could ultimatley be a lot of these temp tables and corresponding queries - hence the desire to do all this outside the main db).

Any ideas?!?

Thanks!

Adrian
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 06:32 PM