VB/Access Data Validation
I am developing a VB standard exe front end to an Access database. On one of my forms I import data from txt and Excel files. I need to validate the data in these records before loading into the database. Specifically, one of the fields being imported is a required foreign key that I need to validate against the primary key of another table.
The way that I plan to do this is running a SQL query (using ADO) and checking the record count of the resulting recordset. If it is greater than 0, then the field has already been set up and is valid. What other ways are there to validate a specific field against another table? I suppose I could load all valid fields into an array prior to starting the import, then search the array to validate each record. Any suggestions from the gurus?
Also, in this same project. I am using DAO on some forms and ADO on others. Is there any problem with this (other than increasing the overhead associated with the exe)?
Would greatly appreciate any comments. I am still working my way up the learning curve.
SB
VB/Access Data Validation
Thanks for the input. I initially intended to only use DAO for this application since it is a single user, MS Access DB. I just started to learn ADO and wanted to try it out, so I wrote some code for the importing of text files into the db. It appears to work ok with the existing DAO code, but I can easily change it to be consistent.
SB