ADOTable也有locate方法,
with ADOTable1 do Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);另外Table组件可以用find.
with ADOTable1 do Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);另外Table组件可以用find.
Table1.IndexFieldNames:='aa;bb;cc';
Table1.FindKey([12,'we',2345]);
aa bb cc是字段名,[ ]中的是相应的符合条件的值
2. Table1.setkey;
Table1.FieldByName('aa').AsInteger:=12;
Table1.GotoKey;
3. Query1.locate('aa;bb;cc',varArrayOf([12,'we',2345]),[loPartialKey]);
4. Query1.Sql.Add('select aa,bb,cc from myTable where aa=12 and bb='we' and cc=2345');这些够了吧?