Article ID: 190642 - Last Review: March 2, 2005 - Revision: 2.2 PRB: ADODC Error on Reposition When EOFAction Is adDoAddNew
This article was previously published under Q190642 On This PageSYMPTOMS
When you move past EOF, a new blank record is displayed and the ADO Data
Control's EOFAction property is set to 2-adDoAddNew. If you do not enter
data for the new record and move off the record, you get the error message:
Cannot insert an empty row - must have at least one column value set.
CAUSE
ADO does an implicit update on a Move in a recordset. When the ADO Data
Control's EOFAction property is set to 2-adDoAddNew, ADO adds a new record
and allows the user to edit the record in bound controls. When the user
moves off of the newly-created record, ADO does a recordset Update. If the
user has decided not to add a record, leaves the bound controls blank, and
moves off the newly-created record, the attempted update causes ADO to
display the message, "Cannot insert an empty row - must have at least one
column value set".
The ADO Data Control's EOFAction - adDoAddNew behavior is different than the DAO Data Control's EOFAction - Add New behavior and the Remote Data Control's EOFAction - rdAddNew behavior. You will not get a message if you move off of a newly-added record when using the Data Control or the Remote Data Control. RESOLUTION
You can work around this behavior by adding error handling code in the
ADO Data Control's Error event procedure. Here is an example of code to
handle this specific error, which is error number 16389:
STATUS
This behavior is by design.
MORE INFORMATIONSteps to Reproduce BehaviorThis example uses the Biblio.MDB database that is included with Visual Basic.
REFERENCES
In Visual Basic, select Help, Search... and enter "ADO Data Control".
On the form containing your ADO Data Control, select the control, then press the F1 key. | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
