Problem with "BigInt" Data type in MS-SQL Server.

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
JCarlos
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 28.07.2007, 17:06

Problem with "BigInt" Data type in MS-SQL Server.

Post by JCarlos »

The fields with data type "BigInt" in "MS-SQL" behave like "float" and not like Integer.
For example:
Suppose that 2 data bases are had. The one in MySQL and the other in MS-SQL Server, with a table each one.
The structure of the tables is the following one:

MS-SQL Server
CREATE TABLE [dbo].[Table1] (
[Key1] [int] NOT NULL ,
[BI] [bigint] NULL ,
[F] [float] NULL
) ON [PRIMARY]



MySQL
CREATE TABLE `Table1` (
`Key1` int(11) NOT NULL,
`BI` bigint(20) default NULL,
`F` float(9,3) default NULL,
PRIMARY KEY (`Key1`),
UNIQUE KEY `Key1` (`Key1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;




Suppose too that:
var
ZTable1: TZTable;

and that
ZTable1.TableName= 'Table1';

and with the "fields editor" of delphi you adds the field named "BI".

If in the design stage you are using MySQL the code generated by delphi recognizes this field like LargeInt. (That is OK).

If after that, the connection (Using the component TZConnection) is switched to "MS-SQL Server", then the following error it is shown when you try to put
Ztable1.active=true:

---------------------------
ZTable1: Type mismatch for field 'BI', expecting: LargeInt actual: Float.
---------------------------

Note:
If you not adds any Field using the "fields editor" of delphi to the Ztable1. All is OK. But some time is necesary to adds field. For example when you need use a lookup field etc.
tweidelt
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 11.08.2007, 00:25

Post by tweidelt »

If Zeos thinks BIGINT is a float value, that is a bug.
Please do a bug report at:
> http://zeosbugs.firmos.at/
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Tweidelt,

Maybe you should first check the buglist. JCarlos did add this bug already. http://zeosbugs.firmos.at/view.php?id=54

BTW, do you think you could try to debug this problem?

Mark
tweidelt
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 11.08.2007, 00:25

Post by tweidelt »

Hi Mark,

you are right. I just wanted to advertise the bug tracker a bit.
I tried to reproduce the problem now with the ADO driver and "MS SQL Server 2005 Express", but it seems to work for me. Hello Carlos, how did you connect to the server? What driver did you use?

Tobias
JCarlos
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 28.07.2007, 17:06

Post by JCarlos »

Hi every one.

Well to conect to MS SQL using Zeoslib I had to use:
NTWDBLIB.DLL

File Version: 2000.080.0194.00
Language Spanish (International Sort)
Legal Trademarks: Microsoft® y Windows® son marcas registradas de Microsoft Corporation.
Product Version: 8.00.194
Size: 278 585 bytes

and to conect to MS SQL using Ado technology I use the following connection string:
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=Admin;Initial Catalog=Test;Data Source=VWin2003".
The Ado driver I thing that is the provided by Borland Delphi 2006. Iam no sure.
I will attach here the code that I was testing.

Remenber that you need switch the protocolo from MySQL to "MS-SQL Server", in order to reproduce the problem.
If you make all design with MS SQL Server, all is OK, but if you make the design with MySQL and after that, in Run Time for example, you change to the MS SQL protocolo, then the problem happen.

Best regard
JCarlos
You do not have the required permissions to view the files attached to this post.
Post Reply