Page 1 of 1
Empty (' ') Date fields in SQL Server 2012
Posted: Tue 13 Nov 2012 20:57
by jrheisler
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
Re: Empty (' ') Date fields in SQL Server 2012
Posted: Wed 14 Nov 2012 12:25
by AndreyZ
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.
Re: Empty (' ') Date fields in SQL Server 2012
Posted: Wed 14 Nov 2012 14:52
by jrheisler
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!
Re: Empty (' ') Date fields in SQL Server 2012
Posted: Wed 14 Nov 2012 14:58
by AndreyZ
I moved this topic to the UniDAC forum.
Re: Empty (' ') Date fields in SQL Server 2012
Posted: Wed 14 Nov 2012 15:00
by AndreyZ
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
Posted: Wed 14 Nov 2012 16:55
by jrheisler
Upgraded, works like a charm. Thanks!!!
Re: Empty (' ') Date fields in SQL Server 2012
Posted: Thu 15 Nov 2012 10:06
by AndreyZ
It is good to see that the problem was solved. Feel free to contact us if you have any other questions about UniDAC.