Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Good day, I need advice, plz Find similar branches


DeadMoroz   (2001-12-03 15:21) [0]

To search the table I use the standard process:

procedure TForm1.Edit1Change (Sender: TObject);
begin
if Edit1.Text <> "" then
begin
Table1.Locate ("NUM", Edit1.Text, loCaseInsensitive, loPartialKey]);
end;
end;

but, in this case, the "NUM" field of the Int type ... In short, the cursor crawls to the record only when Text is completely matched with the field value, that is, there is no loPartialKey, but I would like to. I tried all the other methods (and Pos too) ... eventually came here.

Advise who can do what, thank you in advance :-).



Deniz   (2001-12-03 15:50) [1]

procedure TForm1.Edit1Change (Sender: TObject); var i: integer; begin if Edit1.Text <> "" then begin TmpQuery.SQL.Clear; TmpQuery.SQL.Add ("select num from table1 where cast (num as varchar (20)) like: aNum "); TmpQuery.Prepare; TmpQuery.Params [0] .asString: = Edit1.Text; TmpQuery. Open; if TmpQuery.IsEmpty then begin Tmpquery.close ShowMessage ("Not found."); Exit; end else begin i: = TmpQuery. Fields [0] .asInteger; Tmpquery.close Table1.Locate ("NUM", i, []); end; end; end;
TmpQuery - Temporary Query
Good luck.



DeadMoroz   (2001-12-03 16:09) [2]

The fact is that my Table1 is a Master and still the cursor needs to be moved to its DataSet "e .... although I will try to tie TmpQuery on the same DataSet1 ...



DeadMoroz   (2001-12-04 09:16) [3]

I tried ..... it works, but a terrible brakes ...

Any more tips?



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.81 MB
Time: 0.031 c
3-21917
Termik
2001-12-04 11:43
2002.01.08
Accessing a table by a name recorded in a variable


7-22423
Alex_K_xelA
2001-09-21 18:55
2002.01.08
Reading sectors from a CD-ROM


6-22281
Verona
2001-10-04 12:22
2002.01.08
Sending messages to e-mail


14-22388
Merlin
2001-11-08 11:43
2002.01.08
Another dirt in the pantry


14-22396
Merlin
2001-11-02 09:54
2002.01.08
Today is a happy day! Besides that, Friday ...





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish