Passing datetime values from a VB app via ADO

Passing datetime values from a VB app via ADO

Post by John Hollan » Thu, 09 Aug 2001 20:11:16



I am passing the date and time (as a string) at the start
of a call to a SQL Server 2000 database from a VB app
using a stored procedure to insert the record. The format
of the string is:
5 August 2001 12:00:30

When the application is run by our American clients it
records the date in dd/mm/yyyy hh:mm:ss format between the
1st and the 12th of the month and then in the required
American format for the remainder of the month. Any one
got any ideas into what is happening?

I have a test machine setup with US configuration and the
application works fine!

 
 
 

Passing datetime values from a VB app via ADO

Post by Tibor Karasz » Thu, 09 Aug 2001 20:19:38


Your VB code changes the string because of regional settings. I prefer to parse the
elements and build up a format which is safe in SQL Server (see datetimerepresentation
FAQ entry).

--
Tibor Karaszi, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com


Quote:> I am passing the date and time (as a string) at the start
> of a call to a SQL Server 2000 database from a VB app
> using a stored procedure to insert the record. The format
> of the string is:
> 5 August 2001 12:00:30

> When the application is run by our American clients it
> records the date in dd/mm/yyyy hh:mm:ss format between the
> 1st and the 12th of the month and then in the required
> American format for the remainder of the month. Any one
> got any ideas into what is happening?

> I have a test machine setup with US configuration and the
> application works fine!