Autor Beitrag
majolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Sa 06.07.02 23:19 
Ich habe ne ListBox und eine Paradox7Datenbank.
Ich möchte, dass der Inhalt der ListBox mit der Spalte1 DB verglichen wird.Wenn der Eintrag vorhanden ist soll ein Ereignis geschehen und der Eintrag aus der Listbox gelöscht werden, wenn nicht ein anderes Ereignis geschehen. Hat einer ne Lösung.
Gruß
majolo 8)
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: So 07.07.02 21:13 
Hallo majolo,

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
{ Listbox durchlaufen }
for i := 0 to ListBox1.Items.Count -1 do
begin
  if DB.Locate('Spalte1', ListBox1.Items.Strings[i]) then
  begin
    { Listboxeintrag gefunden }
     ...
  end
end;


Wenn Spalte1 ein Schlüsselfeld ist, kannst du auch:

ausblenden Quelltext
1:
2:
3:
...
  if DB.FindKey([ListBox1.Items.Strings[i]]) then
  ...

benutzen.

_________________
Live long and prosper
MrSpock \\//
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: So 07.07.02 22:05 
Vielen Dank.Majolo