Query not updateable

前端 未结 1 1909
灰色年华
灰色年华 2021-01-25 04:14

I am trying to update local Access 2007 table with records from BE SQL Server 2012 Express. My steps here:

  1. In SQL Server exists Stored Procedure with 4 parameter

相关标签:
1条回答
  • 2021-01-25 04:24

    Access always treats an UPDATE which includes a joined pass-through query as read-only. And that holds true even when the UPDATE does not attempt to alter values in the pass-through.

    As you mentioned in a comment, you could store the pass-through result set in an Access table. Joining that table in place of the pass-through in the UPDATE should work. However, you also mentioned that seems a bit dirty. No argument there. :-)

    So perhaps you would prefer to use DLookup to fetch qryTemp.GraphHrs values for the UPDATE. This one should work, but I don't know whether the execution speed will be acceptable ...

    UPDATE tbl_tmp_Tab_s
    SET tbl_tmp_Tab_s.GraphHrs =
        DLookup(
            "GraphHrs",
            "qryTemp",
            "EmplCodeID0=" & EmplCodeID0
            );
    

    If the datatype of EmplCodeID0 is text rather than numeric, include quotes around its value ...

            "EmplCodeID0='" & EmplCodeID0 & "'"
    
    0 讨论(0)
提交回复
热议问题