Field mismatch

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Senad
Posts: 34
Joined: Tue 10 Dec 2013 08:07

Field mismatch

Post by Senad » Mon 23 Oct 2017 04:55

I have a very strange issue running an aplication under windows 10. In Windows 7 everything runs fine.

The issue is this: I am running a stored procedure (Unistoredproc1) against SQL server 2014 that basically gets all the data from the table i.e a simple select statement. However, on one field I am getting an error. "Type mismatch for field MYFIELD,expecting date actual: WideString"

The field in question is a Date field in the sql server database. So why the error ?

Unidac is seven something ... I dont know from this system since its not installed here.

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Field mismatch

Post by Stellar » Wed 25 Oct 2017 12:33

In order for us to analyze the issue, provide us with the script to create the table and stored procedure, as well as a simple sample of the procedure call.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Field mismatch

Post by azyk » Tue 31 Oct 2017 14:05

The point is that standard OLEDB provider processes datetime2 fields as string fields.
To solve the problem, try using SQL Native Client provider. For this, in connection settings set the option TUniConnection.SpecificOptions.Values['Provider'] to 'prNativeClient'.

Post Reply