M
Mus' via AccessMonster.com
Hi
I am trying to build an import routine to handle the import of data from an .
xls file. I am interested to hear feedback from people who have already
tackled similar challenges. I'm not necessarily looking for full answers
(whilst it would be nice it's not for you to do my work) but rather hints,
tips, and considerations.
So far I have written the code to import the data into a new import table.
Once imported I then have added a coupled of extra fields. One of which is
'Errors' which is a memo field. From here I wish to run a number of checks on
the data and where they fail add a pointer to the memo field. Later in the
procedure records that have a null/empty 'Error' field will be imported and
the rest reported back to the user with the error description.
Checks to perform:
1) Remove empty records (empty rows are sometimes pulled in from Excel).
I did consider counting number of fields in the table and for each record if
the value is null/empty incrementing an integer. If the final value of the
integer equals the field count then delete the record. Any better suggestions?
2) Check field names are valid (against table that data will be appended to)
I’m considering creating an array of field names from the destination table,
and then checking all field names against this array….but haven’t used arrays
before!
3) Possibly change any user friendly fieldnames/headings imported from the
worksheet to match those in the destination tables. I should be OK with this.
4) Check compulsory fields have been completed. I should be ok on this.
5) Check data confirms to any constraints/validation. I should be ok on this.
6) Check that the data will go to destination table.
Preferably before running the final append. Any ideas welcome?
7) Trap error/acknowledge whether append is successful.
Any ideas welcome?
All thoughts welcome.
Thanks.
I am trying to build an import routine to handle the import of data from an .
xls file. I am interested to hear feedback from people who have already
tackled similar challenges. I'm not necessarily looking for full answers
(whilst it would be nice it's not for you to do my work) but rather hints,
tips, and considerations.
So far I have written the code to import the data into a new import table.
Once imported I then have added a coupled of extra fields. One of which is
'Errors' which is a memo field. From here I wish to run a number of checks on
the data and where they fail add a pointer to the memo field. Later in the
procedure records that have a null/empty 'Error' field will be imported and
the rest reported back to the user with the error description.
Checks to perform:
1) Remove empty records (empty rows are sometimes pulled in from Excel).
I did consider counting number of fields in the table and for each record if
the value is null/empty incrementing an integer. If the final value of the
integer equals the field count then delete the record. Any better suggestions?
2) Check field names are valid (against table that data will be appended to)
I’m considering creating an array of field names from the destination table,
and then checking all field names against this array….but haven’t used arrays
before!
3) Possibly change any user friendly fieldnames/headings imported from the
worksheet to match those in the destination tables. I should be OK with this.
4) Check compulsory fields have been completed. I should be ok on this.
5) Check data confirms to any constraints/validation. I should be ok on this.
6) Check that the data will go to destination table.
Preferably before running the final append. Any ideas welcome?
7) Trap error/acknowledge whether append is successful.
Any ideas welcome?
All thoughts welcome.
Thanks.