Re: Delphi 6 - Data type conversion error, please help
From: Jamie (jamie_5_not_valid_after_5_Please_at_charter.net)
Date: 07/20/04
- Next message: Martin Harvey (Demon Account): "Re: teaching a child - console or GUI"
- Previous message: Johnny 5: "Re: teaching a child - console or GUI"
- In reply to: Alan: "Delphi 6 - Data type conversion error, please help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 20 Jul 2004 13:57:48 -0700
for what ever reason your numbers are going over the 4 billion mark.
a 32 bit integer can only hold 2^32
which is around 4.2 billion.
if you really need to work with large numbers like that then try using
an int64 or a float.
Alan wrote:
> I have a stored procedure object on a form I've created with Delphi 6.
>
> The stored procedure object uses SOAP to connect to a Microsoft SQL
> 2000 server.
>
> One of the parameters required by the stored procedure is an Integer
> ID variable (let's called it record_ID).
>
> The record_ID numbers appear to have gotten larger than a standard
> Integer variable; for example, passing 918888847 as the record_ID
> works fine, but passing 7111111297 (one digit longer than the first
> one) gives "Error converting data type numeric to int".
>
> What's the best way to fix this?
>
> I've enabled the SQL stored procedure to work by declaring the
> record_ID input variable as "bigint" instead of "integer". In Delphi,
> the variable there is still a plain "integer", I'm guessing I need to
> change the variable type:
>
> myvariable : Cardinal;
>
> ...or whatever type is big enough, then pass this to the stored
> procedure in Delphi like this:
>
> sp_MySQL_stored_proc.Params.FindParam('record_ID').AsCardinal :=
> my_field_value;
>
> Please help, thanks!
- Next message: Martin Harvey (Demon Account): "Re: teaching a child - console or GUI"
- Previous message: Johnny 5: "Re: teaching a child - console or GUI"
- In reply to: Alan: "Delphi 6 - Data type conversion error, please help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|