Autor Beitrag
Fischman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mo 21.04.03 16:39 
Hallo Leute,
Wer kann mir mal wieder weiterhelfen bei mein Problem.In den Code unten drann kommt immer die Showmessage anstatt das Ergebniss.
Bin für jeden Tip offen.

ausblenden Quelltext
1:
2:
3:
4:
5:
Form1.Table1.IndexName:='mein Index';
Form1.Table1.SetKey;
Form1.Table1.FieldByName('Vorname').AsString := 'Edit1.Text';
if not Form1.Table1.GotoKey then
ShowMessage('Die Person wurde nicht gefunden');


Gruß Uwe
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Mo 21.04.03 16:53 
Ich kann nicht so ganz ergründen, was du da eigentlich versuchst...

Suchen tut man mit einem TTable mittels Locate() oder mit nem TQuery via SQL, aber nicht so, das macht da für mich überhaupt gar keinen Sinn.
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mo 21.04.03 19:44 
hallo uwe!

ich kanns mir nur so vorstellen, dass die tabelle nicht indiziert ist, oder der Indexname nicht passt.
benenn den Index in 'NameIdx' anstelle von 'mein Index' um
gibts den Namen in deiner Tabelle, den du in Edit1.Text übergibst?

mfg, stefan
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mo 21.04.03 19:47 
hallo alibi!

mit Table.SetKey und Table.GotoKey kannst auch nach indizierten einträgen suchen.
einfach mal hintippen und F1 drücken! ;)

mfg, stefan
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mo 21.04.03 20:12 
Titel: Suchen in der Datenbank
Hallo Grayfox,
ich habe "mein Index" da hingeschrieben weil ich nicht denn Orginalname dorthin schreiben wollte.

Sonst Danke
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mo 21.04.03 20:14 
hallo uwe!

ok! dann kannst als fehlerursache den grund 'Indexname = Mein Index' abhaken! ;)
so viel bleibt dann nimmer übrig.

mfg, stefan