Question : Access Update Query To Update Date From A Query

Hello All...

I'm pulling my hair out of my head with {bleeping} Access...albeit I have no choice BUT to use Access...as this data is coming via Transoft/ODBC (via a Linux Cobol-based database).

So, basically, I created a very, very "simple" Query in Access...the 'SQL' of which is as follows (noting...that this is joining a TABLE to a QUERY):

SELECT root_PHYSICAL1.ItemNumber, root_PHYSICAL1.Location, root_PHYSICAL1.QtyOnHand, root_PHYSICAL1.Count1, HISTORY_GROUP_QUERY.CORRECT_FREEZE_QTY
FROM root_PHYSICAL1
INNER JOIN HISTORY_GROUP_QUERY
ON root_PHYSICAL1.ItemNumber = HISTORY_GROUP_QUERY.ITEM_NO;

OK...so now that I have that data setup & joined appropriately, all I want to do, is to UPDATE the values in the root_PHYSICAl_1.QtyOnHnd field...to be force populated with the values from the HISTORY_GROUP_QUERY.CORRECT_FREEZE_QTY field.  If this was MSSQL, this would have been a real "no-brainer".  But, Access is fighting me, and now matter what type of syntax I attempted, I kept getting the following dreaded error:

"Operation must use an updateable query".

Please help!  Perhaps by using my code above, somebody can help me formulate the correct SQL Syntax that Access will accept?  Thank You very much to anyone who chimes in, much appreciated!...Mark

Answer : Access Update Query To Update Date From A Query

Thats certainly an improvement... now you just need to step through the code and find which object is null and work out why.

Actually I think I see the problem, you appear to be using a mix of OleDb and Sql - you've created an OleDb connection and then asked it to give you a command - which it will, an OleDbCommand - but then you're tried to cast it to an SqlCommand which won't work.

You need to decide whether you're working on OleDb or native Sql Server and then ensure your code is consistent with your choice.
Random Solutions  
 
programming4us programming4us