Page 1 of 1

Field mismatch

Posted: Mon 23 Oct 2017 04:55
by Senad
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.

Re: Field mismatch

Posted: Wed 25 Oct 2017 12:33
by Stellar
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.

Re: Field mismatch

Posted: Tue 31 Oct 2017 14:05
by azyk
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'.