Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
romeck
Starting Member
16 Posts |
Posted - 2014-05-19 : 13:52:59
|
I create simple VBA module that insert some data to sql through adodb.connection with constring :Public Const MFConnString As String = "Provider=MSDASQL.1;Extended Properties=DRIVER=SQL Server;SERVER=aaaa\f2;UID=fuser;PWD=Mx3;DATABASE=PRODCOT"to simplify sql query seem like that:sql="INSERT INTO [dbo].[MFOSR] ([id],[DocDate] ) Values (1, cast('2014-05-19 19:24:35' as datetime))"as i execute it through con.execute(sql) i recieve sql error: "[Microsoft]ODBC SQL Server Driber][SQL Server] Varchar conversion to datetime type created value out of rangebut as i run it directly through mssql studio management it works perfectly fine. It also has been working just few weeks ago with my VBA module . what could have happend ? db collation is Polish_CI_AS , system locale all polish settings. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-05-19 : 14:11:46
|
It probably stopped working on May 13th. I suspect the issue is with your application thinking that 05 is the day and 19 is the month. Is there an option to change the dateformat setting?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
romeck
Starting Member
16 Posts |
Posted - 2014-05-19 : 14:41:40
|
yup :) set datetime format ymd make it work :)topic to close |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|