I recently starting testing a unidac with sql server provider app against a 2012 SQL Server instance rather than the 2008 version I had been testing against.
I found that one of our older Woll2Woll IP component TwwDBDateTimePicker does not get a date.
As it turns out, in the date time picker, if there is no date, it goes to the database and checks Field.AsDateTime. In 2008 Field.AsDateTime returns a zero (0), in 2012 it returns a ' '.
Is there a setting or something for this?
Thanks
Jeff
Empty (' ') Date fields in SQL Server 2012
-
AndreyZ
Re: Empty (' ') Date fields in SQL Server 2012
Hello,
Most probably that this problem with date formats is caused by the OLEDB provider. The OLEDB provider returns DATE, TIME, DATETIME, and DATETIME2 columns in the string format. To solve the problem, you should use the SQL Native Client provider. To use SQL Native Client, you should set the TMSConnection.Options.Provider property to prNativeClient.
Most probably that this problem with date formats is caused by the OLEDB provider. The OLEDB provider returns DATE, TIME, DATETIME, and DATETIME2 columns in the string format. To solve the problem, you should use the SQL Native Client provider. To use SQL Native Client, you should set the TMSConnection.Options.Provider property to prNativeClient.
Re: Empty (' ') Date fields in SQL Server 2012
I just tried this using the UniConnection, SpecificOptions, Options for provider SQl Server, setting OLEDBProvider=prNativeClient.
When I run the app, and it tries to Uniconnection.Open I get an error in EDatabaseError of 'Required provider is not installed'
This is Devart 4.1.6 for Delphi 7.
Thanks!
When I run the app, and it tries to Uniconnection.Open I get an error in EDatabaseError of 'Required provider is not installed'
This is Devart 4.1.6 for Delphi 7.
Thanks!
-
AndreyZ
Re: Empty (' ') Date fields in SQL Server 2012
The point is that UniDAC supports SQL Server Native Client 11 (SQL Server 2012) since version 4.2.7. To solve the problem, you should upgrade UniDAC at least to version 4.2.7.
Re: Empty (' ') Date fields in SQL Server 2012
Upgraded, works like a charm. Thanks!!!
-
AndreyZ
Re: Empty (' ') Date fields in SQL Server 2012
It is good to see that the problem was solved. Feel free to contact us if you have any other questions about UniDAC.