Inserting a Date field with Informix-CLI
Posted in 1996
Topics: Connectivity: ODBC / JDBC / .NET
I am posting this for one of our programers not on the list. Subject: Inserting a Date field with Informix-CLI I am currently having a problem with the INFORMIX-CLI (current version - 2. 00.WD1) and inserting or updating a table when one of the fields is a DATE datatype. I am using Visual Basic 4.0 running under Windows 3.11. All my development has been done using the Intersolv ODBC drivers, and i had no problems [accessing/modifying Online 5.x and Standard 7.x databases]. We switched to Informix's CLI. Now i get errors on inserting/updating dates. I have figured out that the only date format that is accepted is '1996-9-5'. I would prefer the format '9/5/1996'. My DBdate variable is not set. But is should default to MDY4/ (or MDY2/ - i don't have my manual in front of me ) if it is not set. Even if i set it to 'MDY4/' or 'MDY2/', it will still only accepts the format '1996-9-5'. I called Informix support. They could not find an answer for me. It can't be a problem in I-NET since i can switch back to the Intersolv driver and dates are accepted in MM/DD/YYYY format. also with CLI, if '' (a null string) is inserted into a date field then a "String to date conversion" error occurs [Intersolv accepted this value]. Thanks. Regards, Greg (gdc) __________________________________________________________________ Gregory D. Chandler aka N2MQO Email: gchand@rome.iitri.com Reliability Analysis Center (RAC) 201 Mill Street WWW: http://rome.iitri.com/rac/ Rome, NY 13440 USA Voice: 315-339-7046 FAX: 315-339-9932 _____________________** a DoD Information Analysis Center (IAC) **_