Re: localized ODBC driver datetime issue
- From: "Dmitriy Ivanov" <divanov@xxxxxx>
- Date: Tue, 6 Dec 2005 20:56:46 +0300
Hello Sergey,
"Sergey Simakov" <sim@xxxxxxxxxxxxx> wrote:
SS> I have a problem with ODBC driver "MS SQL Server, version
SS> 2000.80.194.00", which I use to connect to MS SQL Server 2003.
SS> I have created a table T with a field DT of type datetime. Records
SS> are inserted and removed to/from the table via
SS> CDatabase::ExecuteSQL() API call. When I attempt to insert a record with
the
SS> date containing Dec. 1, 2005 I use the following SQL statement: INSERT
INTO
SS> T (DT) VALUES ('2005-12-1'). This procedure works just fine if DSN
SS> property "Language of SQL Server system messages" is set to English
SS> (the default) via the ODBC Data Source Administrator.
SS> But the same method fails if the property described above set to
SS> Russian. The failure manifests itself by switching month and day
SS> parts of the date, so Dec. 1, 2005 becomes Jan. 12, 2005. Moreover,
SS> if the date value used is Dec. 13, 2005, an error occurs stating
SS> that the month value is out of range. It seems to me that ODBC
SS> driver should not convert the date according to this strange
SS> format, because this format does not correspond to the Russian date
SS> format standard. This problem could have been alleviated if there
SS> was a way to know the language used by the ODBC driver, but it
SS> would required extensive modifications to the code that is
SS> responsible for the SQL query creation and formatting.
SS> Also I suppose that ODBC driver should not convert the date in the
SS> canonical format at all.
SS>
SS> Is there a way to resolve or to avoid this problem?
SS> Your attention to the matter is greatly appreciated.
Have you tried the escape sequence for a date literal like this:
INSERT INTO T (DT) VALUES ({d '2005-12-01'});
?
--
Sincerely,
Dmitriy Ivanov
Common Lisp ODBC interface - www.ystok.ru
.
- Prev by Date: Re: Create Table binary fields
- Next by Date: RE: number of rexords in a record set
- Previous by thread: RE: localized ODBC driver datetime issue
- Next by thread: Re: Create Table binary fields
- Index(es):
Relevant Pages
|