MS Access, update query will not update a linked t

2019-08-07 20:37发布

I have a remote user with a version of my db and a half dozen users interacting with front end versions of the db. The back end lives on the network drive. The remote user cannot use the network drive because it is too slow through the VPN. So daily or so I plan to update the db on the network drive with data from the remote user.

I have this query set up but it does nothing.

UPDATE Tbl2 
INNER JOIN Tbl1 
ON (Tbl1.thing1 = Tbl2.thing1) 
AND (Tbl2.[thing2] = Tbl1.[thing2])
AND (Tbl1.[thing3] = Tbl2.[thing3]) 
AND (Tbl2.[thing4] = Tbl1 thing4]) 
AND (Tbl1.[thing5] = Tbl2.[ thing5])
SET Tbl2.[ thing1] = [Tbl1].[ thing1], Tbl2.[ thing2] = [Tbl1].[ thing2], Tbl2.[ thing3] = [Tbl1].[ thing3], Tbl2.[thing4] = [Tbl1].[ thing4], Tbl2.[thing5] = [Tbl1].[ thing5];

I get no errors, no security warning and no output. Nothing changes in either table.

What am I missing?

Thank you!

1条回答
爷、活的狠高调
2楼-- · 2019-08-07 21:11

you're joining tables on all of their values and then updating them to the same values. If things 1 -> 5 are the compound primary key fields, then your update statement should update fields 6->n. If field1 is your PK field, then your update statement should update values for field2 -> fieldn.

In other words, whichever things you join on should not be updated.

HTH,

-Beth

查看更多
登录 后发表回答