The boss has given me the code for an old system written in VB6 that connects to a SQL Express database.
When the code runs it flags up the error
Run-time error -2147217913 (80040e07)
The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value
When I debug the code the date it's trying to select is in the format yyyy-MM-dd
If I change the date format to dd/MM/yyyy, the code runs fine.
I think I've narrowed it down to a locale problem, rather than a code/connection problem.
I've checked all the Windows control panel and SQL Server property settings for locales and date formats and whatnot and apart from I'm on Windows 7, he's on XP, all the settings appear to be the same.
Anyone have any ideas of where a discrepency can occur or any other random ideas on why it doesn't work ? ;-)
Thanks
When the code runs it flags up the error
Run-time error -2147217913 (80040e07)
The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value
When I debug the code the date it's trying to select is in the format yyyy-MM-dd
If I change the date format to dd/MM/yyyy, the code runs fine.
I think I've narrowed it down to a locale problem, rather than a code/connection problem.
I've checked all the Windows control panel and SQL Server property settings for locales and date formats and whatnot and apart from I'm on Windows 7, he's on XP, all the settings appear to be the same.
Anyone have any ideas of where a discrepency can occur or any other random ideas on why it doesn't work ? ;-)
Thanks