Set dateformat issue

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 7
Joined: Fri 08 Sep 2006 14:54

Set dateformat issue

Post by baumsh » Fri 16 Nov 2007 17:13


I've noticed that when a connection connects to SQL Server the first time SDAC passes in a lot of SET function, 2 of them I'm wondering if they are right in particular the SET dateformat, I see that even on system that is defined to have a date format as dmy it always sets upon connection to 'mdy' and when I pass down on a machine as a string that has '30/11/07' sql server will obviously generate an error.

So basically my question is if there is a way that SDAC connection should get the clients system date format and pass that down to SQL Server.

Also the language is always set to US_English even on a non us machine.

Thanks in advance
Shloma Baum
Pioneer Interactive, Inc.

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 19 Nov 2007 16:28

These SET commands are executed by the underlying SDAC provider (SQL OLEDB or SQL Native Client). Some of them can be changed with properties of TMSConnection.

By default SDAC does not setup the value of the "language" parameter. You can change the "language" parameter value using the TMSConnection.Options.Language property. To change the date format (the "dateformat" property), you need to execute the "SET dateformat command xxx" command with the required value instead of xxx just after connect.

Post Reply