Recent

Author Topic: access violation while selecting positions from DBComboBox  (Read 6211 times)

ensim

  • New member
  • *
  • Posts: 7
access violation while selecting positions from DBComboBox
« on: August 31, 2007, 11:40:42 am »
Hi,
I've problem selecting positions from DBComboBox (positions are added by mysql SELECT).

If i'll use mouse to click and select positions I got error 'access violation', but if i'll use keyboard arrows [up and down] everything works fine ...

any ideas?

CODE:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.MySQL50Connection1.Open;
  if Form1.MySQL50Connection1.Connected = True then
     begin
     Form1.SQLQuery1.SQL.Text := 'SELECT * FROM ensim WHERE 1';
     Form1.SQLQuery1.Open;
     while not SQLQuery1.EOF do begin
     Form1.DBComboBox1.Items.Add(SQLQuery1.Fields[0].asString);
     Form1.Label2.Caption := SQLQuery1.Fields[0].asString;
     Form1.DBComboBox1.Text := SQLQuery1.Fields[0].asstring;
     SQLQuery1.Next;
     end;
     Form1.Button1.Enabled := False;
     end
  else
     begin
          Form1.DBComboBox1.Items.Add('Nie można polaczyc');
     end
 
end;

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: access violation while selecting positions from DBComboB
« Reply #1 on: August 31, 2007, 12:35:48 pm »
Which widgetset? AFAIK gtk2 has dbcombobox broken atm.

ensim

  • New member
  • *
  • Posts: 7
RE: access violation while selecting positions from DBComboB
« Reply #2 on: August 31, 2007, 01:37:01 pm »
I'm compiling under windows.

btw. if i wont click the button which gets data from SQL and puts it into combobox application is closing without any errors.

 

TinyPortal © 2005-2018