- The values are read from the file.
- A new data object is created.
- The fields on the data object are set to the values from the file.
- The BeforeImportRecord event is thrown.
- An attempt is made to save the record to the database.
The ImportException event can be thrown during step 3 or step 5.
If it is thrown during step 3, the problem cannot be corrected in the VBA event. When the import resumes, it will start at step 1 with the original values in the file. If the problem was with the value in the import file being invalid, then correcting the value in the data object during the ImportException will be overwritten by the value from the file when the import resumes. Setting the bTryAgain to true will cause an infinite loop in this case.
If it is thrown during step 5, the problem can corrected in the VBA ImportException event and the bTryAgain flag can be set to true. When the import resumes, it will start at step 4 allowing the record to try to be saved.
Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.
Connect and collaborate with fellow Blackbaud users.