1. Emulating SetKey/GotoKey on TQuery
Here's a little brain teaser for you: I am a programmer for a multi-bazzilion dollar international company I have a table containing data about widgets. Each widget has various As you may have guessed, I used the TQuery to narrow the list to only Now the plot thickens... I realize that the widget I am viewing is listed as yellow, but should Luckily, the building was only one storey high, and there was a soft var This would open the dataset again, and allow me to go back to that Whatever shall I do!
that supplies 78% of the world widget market. This company made the
exceptionally wise decision to hire me to write a widget management app
for them called Widgets '95. In this dialog (diatribe?), I will also
play the role of the overworked user, who is on the brink of suicide.
attributes like color, size, shape etc. Since there are thousands of
widgets, I need a means to narrow the list before I select the widget I
want to view. So, I have a little query dialog box that allows me to
filter out, say, all the yellow widgets. Then, I search through my list,
and find the one I want, and select it. This makes a detail screen pop
up, and I may happily view the data pertaining to this widget.
yellow widgets. I then used the same instance of the TQuery as my
DataSet on the detail form.
actually be red. I make these changes, and post them (still in the
detail screen.) However, since this record no longer fits the query
requirements of being yellow, it dissapears, and I, the confused user am
left looking at the next record in the yellow set. Being the frustrated
user that I am, this is the precise moment when my psyche snaps, and I
thow myself off the roof of my office building in despair...
lawn at the bottom, so I survived my ordeal, but now I must fix this
dastardly problem. How do I do it? I try this:
KeyNum: Integer;
begin
KeyNum := Query1.FieldByName('KeyField').AsInteger;
{This is a routine that closes the Query1, clears all the
parameters, and opens with the entire dataset}
ClearQuery;
Query1.SetKey;
Query1.FieldByName('KeyField') := KeyNum;
Query1.GotoKey;
end;
record that was changed. Only one problem. TQuery doesn't have SetKey
and GotoKey methods, only TTable has that.
2. DTSRun
3. Quirk: Paradox vs dBase SetKey...GotoKey
5. Q : Interbase and Setkey and Gotokey
8. help
10. DOS 3.5 Capslock, and SetKey questions.
12. PDOX 4.0 Dos Setkey Question
13. Clipper SETKEY and SETCANCEL