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;