Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application which reads job candidates data from an Excel spreadsheeet via ODBC and populates the same in an ACCESS table via ODBC. I am facing a couple of issues.
The first problem is with the date of birth field in Excel. A sizeable number of candidates have their DOB listed as "N/A". SQLGetData returns SQL_ERROR for this field but returns the correct ("N/A" ) data present. This is causing me to employ a lot of hacks. Is there a setting to make SQLGetData return SQL_SUCCESS or SQL_SUCCESS_WITH_INFO for "N/A".
The second problem is with the date of birth field in Access. Is there a way to specify a NULL date for the above mentioned field where the corresponding values in Excel are "N/A"?

What I have tried:

Visual Studio Debugging. Online help.
Posted
Updated 25-Jun-18 4:18am

1 solution

It would help if you'd post at least some of the code you're using to read in the XLS and to submit it into the DB. I believe your best bet will be to attempt to convert the value that you get from the XLS to a Date type value. If that attempt fails then use NULL when inserting the record (make sure the field allows null values).

HTH,
Mike
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900