Date format on ADO/SQL Server/ COM+

dadscorp used Ask the Experts™

I have a 4 tier application. The components are on a different server than the webpages . The SQL server is on a different machine. I am creating a recordset in the component. I have found that the date format of the date depends upon the regional setting of the machine in which the Recordset is created. What I want to know is whether it will depend on the date format of the SQL server also. What about the date format of ADO ?

Would appreciate if I could get quick answer.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Normally what i do is when accessing a date field i access it in dd-mmm-yyyy format so that my program will not give trouble what ever setting is in the computer

while creating a recordset try convert function


select convert(varchar(12),date,106) from sample
    there is no actual date format for any ado, but as you said the date format is depended on the regional settings of the machine. anyway in SQL it will store the date format in 'yyyy-mm-dd hh:mm:ss' format so you can use the same while checking dates if you needed.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial