B
blinton25
Hello,
How are you today?
I use the following code to update a field in [Input
table].
'Identtify errors
Set Errorsqry = db.CreateQueryDef("", _
"SELECT IT.[TRAV-KEY],IT." & DynFN & " FROM [input table]
AS IT LEFT JOIN [" & DynLookupTable & "] AS AC ON IT." &
DynFN & " = AC.[" & DynLookupField & "] WHERE AC.[" &
DynLookupField & "] Is Null")
Set Errorsrst = Errorsqry.OpenRecordset(dbOpenDynaset,
dbSeeChanges)
Me.Repaint
If Not (Errorsrst.EOF) Then
Errorsrst.MoveLast
Errorreccount = (Errorreccount + Errorsrst.RecordCount)
Me!Processed = Errorreccount
Me.Repaint
Errorsrst.MoveFirst
'Update error fields with description of error
Do Until Errorsrst.EOF
Set UpdateErrorStringqry = db.CreateQueryDef("", _
"update [input table] set [input table].ErrorString =
[input table].ErrorString&'" & DynErrorFieldMessage & "'
Where [input table].[TRAV-KEY] = " & Errorsrst![TRAV-KEY])
UpdateErrorStringqry.Execute dbOpenDynaset
Errorsrst.MoveNext
Loop 'Errorsrst
However at:
UpdateErrorStringqry.Execute dbOpenDynaset
I get the following error:
"Run time error '3622':
You must use dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an IDENTITY column"
Any idea why?
How are you today?
I use the following code to update a field in [Input
table].
'Identtify errors
Set Errorsqry = db.CreateQueryDef("", _
"SELECT IT.[TRAV-KEY],IT." & DynFN & " FROM [input table]
AS IT LEFT JOIN [" & DynLookupTable & "] AS AC ON IT." &
DynFN & " = AC.[" & DynLookupField & "] WHERE AC.[" &
DynLookupField & "] Is Null")
Set Errorsrst = Errorsqry.OpenRecordset(dbOpenDynaset,
dbSeeChanges)
Me.Repaint
If Not (Errorsrst.EOF) Then
Errorsrst.MoveLast
Errorreccount = (Errorreccount + Errorsrst.RecordCount)
Me!Processed = Errorreccount
Me.Repaint
Errorsrst.MoveFirst
'Update error fields with description of error
Do Until Errorsrst.EOF
Set UpdateErrorStringqry = db.CreateQueryDef("", _
"update [input table] set [input table].ErrorString =
[input table].ErrorString&'" & DynErrorFieldMessage & "'
Where [input table].[TRAV-KEY] = " & Errorsrst![TRAV-KEY])
UpdateErrorStringqry.Execute dbOpenDynaset
Errorsrst.MoveNext
Loop 'Errorsrst
However at:
UpdateErrorStringqry.Execute dbOpenDynaset
I get the following error:
"Run time error '3622':
You must use dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an IDENTITY column"
Any idea why?