VB Migration Partner

KNOWLEDGE BASE - Forms and controls


Previous | Index | Next 

[INFO] Fields are restored in a different way if an error occurs with a Data control

The VB.NET ADO Data control and its DAO and RDO variants behave slightly differently from the corresponding VB6 control if a database error occurs when the end user attempts to move to a different record. A typical error is a referential integrity error, such as when the form contains a control bound to a field that is a foreign key to another table and the end user types a value that isn’t found in the foreign table.

In such circumstance, the VB6 control display an error message box with a generic message such as “Operation was canceled” and the OK button. When the end user clicks the OK button, the value of the field (or fields) that caused the error is automatically restored to what it was when the record was read. An important detail: fields that don’t create any conflict aren’t restored. The neat effect is that, after clicking the OK button the end user can re-try the move operation and in most cases the move will be successful because all conflicting fields have been fixed.

In the same circumstances, the VB.NET control display a more detailed error message, for example “You cannot add or change a record because another record is required in table ‘XYZ’ “ followed by the question “Do you want to restore original field values?”. If the end user clicks on the Yes button all the fields are restored from the data source (not just the fields that caused the conflict) and the user can then perform a successful move operation. On the other hand, if the end user clicks on the No button, no field is restored and he or she has to manually fix the conflicting value before moving to another record.

Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers