Re: localized ODBC driver datetime issue



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


.



Relevant Pages

  • Re: SQL Losing Data
    ... the other problem wasn't a SQL Server thing. ... And I would argue that it was an ODBC driver issue, solely, not even Access. ... sidebar shows a pencil, indicating that edits are being performed. ... I've tried using Profiler in the past and found it a bit unwieldy. ...
    (microsoft.public.sqlserver.odbc)
  • Re: SQL Server 2005 "Left outer join" return nothing through ODBC call
    ... Some outer joins suddenly returned empty resultsets on SqlServer 2005 in 2000-compatibility-mode, but only within our application. ... The same query executed in Query Analyzer just worked fine. ... We finally solved that issue by upgrading to the latest SqlServer ODBC driver which can be found at: ... It did work for SQL Server 7.0 and SQL server 2000. ...
    (microsoft.public.sqlserver.odbc)
  • Re: dts retrieves 0 rows when scheduled...
    ... Have you tried logging in as the SQLAgent service account and running the ... job/checking out the ODBC driver? ... > There is no error massage i can trace in sql server or in any of its logs, ... > the job just passes gracefully by the dts data transfare tasks, ...
    (microsoft.public.sqlserver.dts)
  • Re: Connection with MS-SQL server
    ... http://www.actualtechnologies.com just released an ODBC Driver for Microsoft ... SQL server. ... > But this I know, and know full well: / I do not trust thee, Cage from Hell. ... > unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe ...
    (RedHat)
  • Re: Questions about 32- and 64-bit ODBC
    ... connectors, but only SQL Server for the 64bit ODBC connectors. ... a 32-bit SQL Server ODBC driver ... instance of 64-bit SQL Server via TCP/IP or named pipes. ...
    (microsoft.public.data.odbc)