In my application ADO Connection’s Open() method is used to open connection
to SQL Server. Using profiler I see the following for Audit Login event:
-- network protocol: TCP/IP
set quoted_identifier on
set implicit_transactions off
set cursor_close_on_commit off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set language us_english
set dateformat mdy
set datefirst 7
I figured out that some of the above settings can be changed
programmatically via Properties collection of the Connection object. For
example, it is possible to specify language using “Current Language” property
if Provider is SQLOLEDB.
My question is about changing dateformat setting: how to do this?
Please do not offer to issue “SET DATEFORMAT …” command. I need to influence
it in the above packet. Changing default login language also is not an option
because I need to set only date strings input format and do not change
anything else.
With best regards
Martin Rakhmanov
http://jimmers.russia.webmatrixhosting.net/
Date formatting is a client side issue. The application code needs to do it.
The other option is the convert it to a string at select time, using the
appropriate time format (see convert in BOL).
SQL Server is a database, not a presentation tier.
Regards
Mike
AMB
"jimmers" wrote:
> Here is more information: dateformat shown in the Audit Login record comes
> from login default language. Seems that it is not possible to set this using
> ADO Connection object properties for SQLOLEDB provider.