PRB: Error 3219 When Updating Record Set Created w/ DistinctID: Q104459
|
Trying to perform an update on a result set created with the Distinct predicate results in error 3219 "Can't perform operation, it is illegal."
An object variable or a data control result set created with the Distinct
predicate is not updatable according to Help. The following statement is in
the Distinct keyword Help topic:
The output of a query that uses Distinct is not updatable and doesn't reflect subsequent changes made by other users. Therefore, when you use the Distinct predicate in a query, you are prevented from trying to update your records.
The only workaround at this time is to not use the DISTINCT predicate to build the results set. Note that you may have to handle the duplicates by some other coding means.
This behavior is by design.
Control Name Property New Value Comment
------------------------------------------------------------------------
Command1 Caption "Set Up Distinct Predicate"
Command2 Caption "Press for Update"
Data1 DatabaseName BIBLIO.MDB Provide the
full path to
this file,
which should
be in C:\VB
Data1 RecordSource Authors
Text1 DataSource Data1
Text1 DataField Author
Sub Command1_Click ()
'* Enter the following two lines of code as one, single line:
data1.RecordSource = "Select DISTINCT Author From authors
where author > 'a'"
data1.Refresh
End Sub
Sub Command2_Click ()
data1.Recordset.Update
End Sub
Additional query words: 3.00
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: June 8, 1999