03Explorer
Technical User
I have code that updates a table with two different but similar fields to be updated. Neither updates deal directly with an IDENTITY column. However ONE of them uses the IDENTITY column in the WHERE statement. The 2nd code works like expected... the first crashes saying "You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column."
Table in question is a linked table (MS SQL table)
Recap: line of code with 3 crashes; the line of code with 4 works
Any rhyme to the reason why 3 code is giving IDENTITY error and not 4?
Table in question is a linked table (MS SQL table)
Code:
SQL = "UPDATE tblSurveysPreGenerated SET [PreGeneratedStatus] = 3, [GeneratedDate] = #" & Date & "#, [GeneratedTime] = #" & Format(Now(), "hh:nn:ss") & "#, [Processed] = 1 WHERE PreGeneratedAutoID = " & rsPreGenerated!PreGeneratedAutoID & "; "
db.Execute SQL
SQL = "UPDATE tblSurveysPreGenerated SET [PreGeneratedStatus] = 4, [Processed] = 1 WHERE isNull([Processed]) AND isNull([GeneratedDate]) AND isNull([GeneratedTime]); "
db.Execute SQL
Recap: line of code with 3 crashes; the line of code with 4 works
Any rhyme to the reason why 3 code is giving IDENTITY error and not 4?