Autor Beitrag
inselberg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458



BeitragVerfasst: Di 26.08.03 10:02 
moin,

gibt es eine möglichkeit in einem dbgrid (adoquery) an eine gewisse postion zu springen?

adoquery1.RecNo hilft mir aber nich weiter, da ich zwar den (numerischen)schlüssel des datensatzes kenne, jedoch die datensetze alphabet. geordnet sind.

die komplette tabelle zu durchlaufen kann aber auch nicht die einzige lösung sein.

danke
bin für jeden tipp zu haben.

beispiel:
tabelle
id name
1 hans
2 anton
3 fritz
4 jürgen
5 berta

grid
2 anton
5 berta
3 fritz
1 hans
4 jürgen

springen nach berta

_________________
hans bist du das ?
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 26.08.03 10:34 
So wie Du sie im Grid hast, so sind sie auch im Query, Berta steht da also auch nach dem ersten, Du brauchst nur ein Next machen.

Oder versteh ich Deine Frage nicht richtig?
inselberg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458



BeitragVerfasst: Di 26.08.03 10:57 
ja das ist schon richtig das betra an 2. position steht ;) und ich mit nem next dahin komme, nur mein problem ist ich weiss nicht wo "berta" steht.

ich füge ja immer neue namen ein, und möchte dann halt auf das zu letzt eingefügte springen, die ausgabe - im dbgrid - ist jedoch "ORDER BY name", so dass zwar das zuletzt eingefügt bei einer sortierung "ORDER BY id" hinten stehn würde, jedoch weiss ich nicht wo es steht bei "ORDER BY name".
uc?

_________________
hans bist du das ?
Socher
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 45

warmes flüssiges Blut
D7 Prof, D8 Prof
BeitragVerfasst: Mo 01.09.03 20:42 
z.B.

Springt zum nächsten Datensatz der im Feld Name oder Vorname Berta oder Müller enthält.

DataSet.Locate('Name;Vorname', VarArrayOf(['Berta', 'Müller',]),[loPartialKey]);

_________________
FREIHEIT