Jump to content


Photo

NextDBInspector and Int64


  • Please log in to reply
15 replies to this topic

#1 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 05 February 2012 - 09:23 PM

Hallo Boki..

I have BIGINT (unsigned) field in MySQL, but I have no idea which itemproperty I can use, since the field value is greater than 294967295. it is out of Cardinal type range.

I want to work with Int64 var in my DBInspector, how?

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 05 February 2012 - 10:37 PM

Hi Anderson,

You may use NxDBSpinItem.

Please tell me if you find some problems.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 06 February 2012 - 01:50 AM

Thank you Boki....

but I have a problem, It can't handle value more then 294967295. or tell me if I miss something

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 February 2012 - 03:34 AM

Hi Anderrson,

Spin item store Double value so it should be fine for using. Maybe you are not using proper TField type? But , I may set a {$DEFINE} to use Extended instead of Double.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 06 February 2012 - 08:30 AM

Thank you Boki.
I use MySQL, and BIGINT(unsigned) for the Field type.

this is screen capture of sample problem
Posted Image

In my NextDBGrid it works fine, but I get invalid value in the NxDBInspector.
for Field with value 2147483648 it would be come -2147483648 in NxDBSpinItem

they both use the same DataSource and off course same DataSet.
but I get different value.
I use NxDBNumberColumn for NxDBGrid side.

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 February 2012 - 09:07 AM

Hm. Not sure why TextItem doesn't display whole value.

I will do a investigation to see what may cause a problem.

thanks.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 07 February 2012 - 08:17 AM

Hi,

I have investigated more.

Can you please tell me which DataType (ftInteger, ftLongInt...) return Field connected to this field? This will help.

Thanks.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 07 February 2012 - 01:33 PM

MyQuery1.Fields[3].DataType

It is ftLargeInt

unfortunately there is no TField.AsInt64. maybe we can use TLargeIntField(DataField).AsLargeInt ?

thankyou

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 February 2012 - 02:16 AM

Hi Anderson,

Can you please tell me which Delphi version you use? It seems that AsLargeInt existing in Delphi 2010+ , but not sure it is existing in your version.

Thank you. I hope that I will find a solution very soon.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#10 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 08 February 2012 - 02:25 AM

Hi..

I am using Delphi 7

Thank you.... I hope so

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 February 2012 - 02:56 AM

Hi,

Can you please update next procedure in NxDBInspector.pas (Sources\Next Inspector)


procedure TItemDataLink.SetField(Field: TField; Item: TNxPropertyItem);
begin
  if Field.IsNull then Item.AsString := '' else
    if (Item is TNxDBComboBoxItem)
      then Item.UpdateField(Field.Value) else
    begin
      case Field.DataType of
        ftString: Item.AsString := Field.DisplayText;
        ftWideString: Item.AsString := TWideStringField(Field).Value;
        ftInteger, ftWord, ftSmallint, ftAutoInc: Item.AsInteger := Field.AsInteger;
        ftLargeint:
        begin
          if Field is TLargeintField then
          begin
            Item.AsInteger := TLargeintField(Field).AsLargeInt;
          end
          else Item.AsInteger := Field.AsInteger;
        end;
        ftFloat, ftCurrency, ftBCD, ftFMTBcd: Item.AsFloat := Field.AsFloat;
        ftBoolean: Item.AsBoolean := Field.AsBoolean;
        ftDate, ftDatetime, ftTime, ftTimeStamp: Item.AsDatetime := Field.AsDateTime;
        ftMemo: Item.AsString := Field.AsString;
        { case }
        else Item.AsString := Field.AsString;
      end;
    end;
end;

Please tell me if we have move from dead point :)
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 08 February 2012 - 10:34 AM

Thank You....

But sorry I could not find any SetField() method in my NxDBInspector.pas.

Interface
  TItemDataLink = class(TDataLink)
  private
    FOwner: TNextDBInspector;
  protected
   procedure ActiveChanged; override;
    procedure DataSetChanged; override;
  procedure DataSetScrolled(Distance: Integer); override;
    procedure UpdateItems;
  public
    constructor Create(AOwner: TNextDBInspector);
  end;


#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 February 2012 - 11:49 PM

Hi Anderson,

Very strange (?) Can you please tell me which version of NextSuite you use?

thanks
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#14 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 09 February 2012 - 05:55 AM

ok i'll check it

I am using ver 5.9.10.1

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 09 February 2012 - 07:54 AM

Hi Anderson,

This seems to clarify things :)

I suggest that you download latest release. Maybe you will not need to change anything.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#16 Anderrson

Anderrson
  • Members
  • 16 posts
  • Gender:Male

Posted 09 February 2012 - 11:01 AM

well, I hope
thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users