Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-06

DBGrid picklist error

23 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bob K.

When using a picklist for a table field that references another table, the list of entries shows in the picklist, but when an entry is selected and I attempt to move to another field the following error appears:

exception class 'EDatabaseError" with message:
"Canon" is not a valid integer.

I understand that the entry should actually be an integer. How can I display the selection, but capture the integer of the referenced table?

bob k.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080629/486e14e3/attachment.html

Reply by email

Bob K.
to Bob K.

Anybody? Please...

Earlier message 19 lines
From: Bob K. Sent: Sunday, June 29, 2008 12:13 PM To: General mailing list Subject: [Lazarus] DBGrid picklist error When using a picklist for a table field that references another table, the list of entries shows in the picklist, but when an entry is selected and I attempt to move to another field the following error appears: exception class 'EDatabaseError" with message: "Canon" is not a valid integer. I understand that the entry should actually be an integer. How can I display the selection, but capture the integer of the referenced table? bob k. --------------------------------------------------------------------------------

Reply by email

Jesus Reyes
to Bob K.

--- El jue 3-jul-08, Bob K. escribi?:

Show quoted text 27 lines
De:: Bob K. Asunto: Re: [Lazarus] DBGrid picklist error A: "General mailing list" Fecha: jueves, 3 julio, 2008, 2:11 pm Anybody? Please... From: Bob K. Sent: Sunday, June 29, 2008 12:13 PM To: General mailing list Subject: [Lazarus] DBGrid picklist error When using a picklist for a table field that references another table, the list of entries shows in the picklist, but when an entry is selected and I attempt to move to another field the following error appears: exception class 'EDatabaseError" with message: "Canon" is not a valid integer. I understand that the entry should actually be an integer. How can I display the selection, but capture the integer of the referenced table? bob k.

Can you please submit a bug report with a sample project, for db samples of preference please use tdbf or firebird (please supply sql script to create and populate db in this case, or db backup)

Jesus Reyes A.

__________________________________________________ Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ?gratis! Reg?strate ya - http://correo.yahoo.com.mx/

Reply by email

Denis Golovan
to Bob K.: Anybody? Please... From: Bob K. Sent: Sunday, June 29, 2008 12:13 PM To: General…
Bob K. wrote 13 lines
Anybody? Please... When using a picklist for a table field that references another table, the list of entries shows in the picklist, but when an entry is selected and I attempt to move to another field the following error appears: exception class 'EDatabaseError" with message: "Canon" is not a valid integer. I understand that the entry should actually be an integer. How can I display the selection, but capture the integer of the referenced table? bob k.

Use RxDBGrid for such lookups. Svn version is preferable http://wiki.lazarus.freepascal.org/RXfpc

Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Jesus Reyes: --- El jue 3-jul-08, Bob K. escribi?: Can you please submit a bug report with a sample…

Will do.

--------------------------------------------------

Earlier message 55 lines
From: "Jesus Reyes" Sent: Thursday, July 03, 2008 4:04 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > > > > --- El jue 3-jul-08, Bob K. escribi?: > >> De:: Bob K. >> Asunto: Re: [Lazarus] DBGrid picklist error >> A: "General mailing list" >> Fecha: jueves, 3 julio, 2008, 2:11 pm >> Anybody? Please... >> >> >> From: Bob K. >> Sent: Sunday, June 29, 2008 12:13 PM >> To: General mailing list >> Subject: [Lazarus] DBGrid picklist error >> >> >> When using a picklist for a table field that references >> another table, the list of entries shows in the picklist, >> but when an entry is selected and I attempt to move to >> another field the following error appears: >> >> exception class 'EDatabaseError" with message: >> "Canon" is not a valid integer. >> >> I understand that the entry should actually be an integer. >> How can I display the selection, but capture the integer of >> the referenced table? >> >> bob k. >> > > Can you please submit a bug report with a sample project, for db samples > of preference please use tdbf or firebird (please supply sql script to > create and populate db in this case, or db backup) > > Jesus Reyes A. > > > > __________________________________________________ > Correo Yahoo! > Espacio para todos tus mensajes, antivirus y antispam ?gratis! > Reg?strate ya - http://correo.yahoo.com.mx/ > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bob K.
to Denis Golovan: Use RxDBGrid for such lookups. Svn version is preferable…

Denis,

I'm having the same problem with RxDBGrid. Are you not having this problem?

bob k.

--------------------------------------------------

Earlier message 33 lines
From: "Denis Golovan" Sent: Thursday, July 03, 2008 4:15 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Thu, Jul 03, 2008 at 03:11:54PM -0400, Bob K. wrote: >> Anybody? Please... > >> When using a picklist for a table field that references another table, >> the list >> of entries shows in the picklist, but when an entry is selected and I >> attempt >> to move to another field the following error appears: >> >> exception class 'EDatabaseError" with message: >> "Canon" is not a valid integer. >> >> I understand that the entry should actually be an integer. How can I >> display >> the selection, but capture the integer of the referenced table? >> >> bob k. > > Use RxDBGrid for such lookups. Svn version is preferable > http://wiki.lazarus.freepascal.org/RXfpc > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote 6 lines
Denis, I'm having the same problem with RxDBGrid. Are you not having this problem? bob k.

Use KeyList/PickList properties, and fill them on form show (or create). Something like the following^

procedure TfrmOrderGoods.DealerPickListFill;
var SQL:TSqlite3Dataset;
    C:TRxColumn;
begin
  C:=grdBusket.ColumnByFieldName('Dealer');
  C.KeyList.Clear;
  C.PickList.Clear;
  SQL:=nil;
  try
    SQL:=BaseConnect.DatasetCreate('select d.id, d.Name from Dealers d order by d.Name');
    while not SQL.EOF do
      begin
	C.KeyList.Add( SQL.FieldByName('id').AsString );
	C.PickList.Add( SQL.FieldByName('Name').AsString );
	SQL.Next;
      end;
  finally
     SQL.Free;
 end;
end;
Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

Denis,

The keylist is not available. I can see it as a property in the columns, but I'm unable to access it:

      with RxDBGridCamera do
        begin
          Visible:=True;
          Columns[0].Visible:=False;
          Columns[1].PickList:=List;
          Columns[1].KeyList:=List;
        end;
rakphoto.pas(115,22) Error: identifier idents no member "KeyList"

--------------------------------------------------

Earlier message 47 lines
From: "Denis Golovan" Sent: Friday, July 04, 2008 11:18 AM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Thu, Jul 03, 2008 at 06:56:54PM -0400, Bob K. wrote: >> Denis, >> >> I'm having the same problem with RxDBGrid. Are you not having this >> problem? >> >> bob k. >> > > Use KeyList/PickList properties, and fill them on form show (or create). > Something like the following^ > > procedure TfrmOrderGoods.DealerPickListFill; > var SQL:TSqlite3Dataset; > C:TRxColumn; > begin > C:=grdBusket.ColumnByFieldName('Dealer'); > C.KeyList.Clear; > C.PickList.Clear; > > SQL:=nil; > try > SQL:=BaseConnect.DatasetCreate('select d.id, d.Name from Dealers d > order by d.Name'); > while not SQL.EOF do > begin > C.KeyList.Add( SQL.FieldByName('id').AsString ); > C.PickList.Add( SQL.FieldByName('Name').AsString ); > SQL.Next; > end; > finally > SQL.Free; > end; > end; > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote 14 lines
Denis, The keylist is not available. I can see it as a property in the columns, but I'm unable to access it: with RxDBGridCamera do begin Visible:=True; Columns[0].Visible:=False; Columns[1].PickList:=List; Columns[1].KeyList:=List; end; rakphoto.pas(115,22) Error: identifier idents no member "KeyList"

Are sure your Columns[1] is of type TRxColumn? TRxColumn definitely contains KeyList (just checked).

TRxDbGrid also has
property Columns: TRxDbGridColumns
Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

The KeyList shows up at design time when I select a Columns property. Is there a way I can tell which type of column it is?

bob k.

--------------------------------------------------

Earlier message 35 lines
From: "Denis Golovan" Sent: Friday, July 04, 2008 1:31 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Fri, Jul 04, 2008 at 11:49:52AM -0400, Bob K. wrote: >> Denis, >> >> The keylist is not available. I can see it as a property in the columns, >> but I'm unable to access it: >> >> with RxDBGridCamera do >> begin >> Visible:=True; >> Columns[0].Visible:=False; >> Columns[1].PickList:=List; >> Columns[1].KeyList:=List; >> end; >> >> rakphoto.pas(115,22) Error: identifier idents no member "KeyList" > > Are sure your Columns[1] is of type TRxColumn? TRxColumn definitely > contains KeyList (just checked). > > TRxDbGrid also has > property Columns: TRxDbGridColumns > > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote
The KeyList shows up at design time when I select a Columns property. Is there a way I can tell which type of column it is? bob k.

Well, Columns.ClassName will return its class as string. Or simply Ctrl+click Columns identifier.

Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

It's TRxDbGridColumns. Why is it different from yours? And is there something I can do about it?

bob k.

--------------------------------------------------

Earlier message 21 lines
From: "Denis Golovan" Sent: Friday, July 04, 2008 3:04 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Fri, Jul 04, 2008 at 02:43:28PM -0400, Bob K. wrote: >> The KeyList shows up at design time when I select a Columns property. Is >> there a way I can tell which type of column it is? >> >> bob k. > > Well, Columns.ClassName will return its class as string. Or simply > Ctrl+click Columns identifier. > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote 5 lines
It's TRxDbGridColumns. Why is it different from yours? And is there something I can do about it? bob k.

Use svn version. I must work right

Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

I'm not sure what you mean by svn version. Lazarus? RxDBGrid?

bob k.

--------------------------------------------------

Earlier message 21 lines
From: "Denis Golovan" Sent: Sunday, July 06, 2008 11:58 AM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Fri, Jul 04, 2008 at 05:11:56PM -0400, Bob K. wrote: >> It's TRxDbGridColumns. Why is it different from yours? And is there >> something I can do about it? >> >> bob k. >> > > Use svn version. I must work right > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote
I'm not sure what you mean by svn version. Lazarus? RxDBGrid? bob k.

Get RxDBGrid svn version (RxFpc - full name)

Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

Denis,

Do you have the link?

bob k.

--------------------------------------------------

Earlier message 19 lines
From: "Denis Golovan" Sent: Sunday, July 06, 2008 12:37 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Sun, Jul 06, 2008 at 12:19:01PM -0400, Bob K. wrote: >> I'm not sure what you mean by svn version. Lazarus? RxDBGrid? >> >> bob k. > > Get RxDBGrid svn version (RxFpc - full name) > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bob K.
to Denis Golovan

I've searched several different sites that I just wanted to be sure I went to the correct one... I don't think Google has banned me... yet :)

So each of these files should be saved in the appropriate RxFpc folder? And then reinstall the components?

bob k.

--------------------------------------------------

Earlier message 25 lines
From: "Denis Golovan" Sent: Sunday, July 06, 2008 1:40 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Sun, Jul 06, 2008 at 01:21:38PM -0400, Bob K. wrote: >> Denis, >> >> Do you have the link? >> >> bob k. > > Use > svn co > https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/rx > > P.S. Google banned you? :) > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Denis Golovan
to Bob K.
Bob K. wrote 7 lines
I've searched several different sites that I just wanted to be sure I went to the correct one... I don't think Google has banned me... yet :) So each of these files should be saved in the appropriate RxFpc folder? And then reinstall the components? bob k.

Exactly.

Best regards, Denis Golovan aka MageSlayer

Reply by email

Bob K.
to Denis Golovan

Denis,

Thank you for your help.

bob k.

--------------------------------------------------

Earlier message 25 lines
From: "Denis Golovan" Sent: Sunday, July 06, 2008 2:23 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Sun, Jul 06, 2008 at 02:03:01PM -0400, Bob K. wrote: >> I've searched several different sites that I just wanted to be sure I >> went >> to the correct one... I don't think Google has banned me... yet :) >> >> So each of these files should be saved in the appropriate RxFpc folder? >> And >> then reinstall the components? >> >> bob k. > > Exactly. > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bob K.
to Denis Golovan: Exactly. Denis Golovan aka MageSlayer

Hi Denis,

I finally had a chance to re-install rxfpc (was on holiday), and the columns are still RxDbGridColumns, so the PickList property is not available. Help!!!

thanks,
bob k.

--------------------------------------------------

Earlier message 25 lines
From: "Denis Golovan" Sent: Sunday, July 06, 2008 2:23 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > On Sun, Jul 06, 2008 at 02:03:01PM -0400, Bob K. wrote: >> I've searched several different sites that I just wanted to be sure I >> went >> to the correct one... I don't think Google has banned me... yet :) >> >> So each of these files should be saved in the appropriate RxFpc folder? >> And >> then reinstall the components? >> >> bob k. > > Exactly. > > -- > Best regards, > Denis Golovan aka MageSlayer > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bob K.
to Bob K.

Anyone???

--------------------------------------------------

Earlier message 47 lines
From: "Bob K." Sent: Monday, July 14, 2008 12:38 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > Hi Denis, > > I finally had a chance to re-install rxfpc (was on holiday), and the > columns > are still RxDbGridColumns, so the PickList property is not available. > Help!!! > > thanks, > bob k. > > -------------------------------------------------- > From: "Denis Golovan" > Sent: Sunday, July 06, 2008 2:23 PM > To: "General mailing list" > Subject: Re: [Lazarus] DBGrid picklist error > >> On Sun, Jul 06, 2008 at 02:03:01PM -0400, Bob K. wrote: >>> I've searched several different sites that I just wanted to be sure I >>> went >>> to the correct one... I don't think Google has banned me... yet :) >>> >>> So each of these files should be saved in the appropriate RxFpc folder? >>> And >>> then reinstall the components? >>> >>> bob k. >> >> Exactly. >> >> -- >> Best regards, >> Denis Golovan aka MageSlayer >> _______________________________________________ >> Lazarus mailing list >> >> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Bob K.
to Bob K.: I finally had a chance to re-install rxfpc (was on holiday), and the columns are still…

Denis,

Is there any way to get the PickList into the RxDBGridColumns. I've attempted to change the columns from RxDBGridColumns to RxColumns but without any luck.

bob k.

--------------------------------------------------

Earlier message 47 lines
From: "Bob K." Sent: Monday, July 14, 2008 12:38 PM To: "General mailing list" Subject: Re: [Lazarus] DBGrid picklist error > Hi Denis, > > I finally had a chance to re-install rxfpc (was on holiday), and the > columns > are still RxDbGridColumns, so the PickList property is not available. > Help!!! > > thanks, > bob k. > > -------------------------------------------------- > From: "Denis Golovan" > Sent: Sunday, July 06, 2008 2:23 PM > To: "General mailing list" > Subject: Re: [Lazarus] DBGrid picklist error > >> On Sun, Jul 06, 2008 at 02:03:01PM -0400, Bob K. wrote: >>> I've searched several different sites that I just wanted to be sure I >>> went >>> to the correct one... I don't think Google has banned me... yet :) >>> >>> So each of these files should be saved in the appropriate RxFpc folder? >>> And >>> then reinstall the components? >>> >>> bob k. >> >> Exactly. >> >> -- >> Best regards, >> Denis Golovan aka MageSlayer >> _______________________________________________ >> Lazarus mailing list >> >> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email