SQL Server 2008 and time fields

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hughespa
Posts: 81
Joined: Sat 23 Aug 2008 08:36
Location: W. Australia

SQL Server 2008 and time fields

Post by hughespa » Mon 11 Jan 2010 14:05

Hi,

I'm using UniDAC, D2010, SQL Server 2008 (Express)

Given a table with the following fields:

JOBDATE DATE,
STARTTIME TIME(0) [ also same with TIME(7) ]
DURATION FLOAT
CLINO INTEGER

and an update statement (shown in DBMonitor) of:

UPDATE VISIT
SET
DURATION = ?
WHERE
JOBDATE = ? AND STARTTIME = ? AND DURATION = ? AND CLINO = ?

where the param values are:

JOBDATE IN Date 21/01/2010
STARTTIME IN Time 08:00:00
DURATION IN Float 0.5
CLINO IN Integer 123456

I get the following error:

The data types time and datetime2 are incompatible in the equal to operator.

What can I do to fix this please?

Is this also related to my earlier post regarding table filter on time fields? I still have no solution to that yet.

Thanks in advance.

Regards, Paul.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 12 Jan 2010 08:40

Please make sure that you have SQL Native Client 2008 installed on your client PC.
And check that the TMSConnection.Options.Provider property is set to the prNativeClient value.

hughespa
Posts: 81
Joined: Sat 23 Aug 2008 08:36
Location: W. Australia

Post by hughespa » Tue 12 Jan 2010 09:25

Hi Dimon,

The Native client (SQL Server Native CLient 10.0) is definitely installed on this development PC.

The Connection.Options.OLEDBProvider was set to prAuto.

However, changing it to prNativeClient doesn't help.

I still get the same error as before.

Regards, Paul.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 13 Jan 2010 13:00

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Post Reply