这是一段数据库删除的代码,我却弄不懂locate这个函数里的[LopartialKey]它代表什么?我运行过程中报错[Error] Unit3.pas(134): Undeclared identifier: 'LopartialKey'和
        [Error] Unit3.pas(134): Incompatible types: 'TLocateOption' and 'Integer',真的不晓得[LopartialKey]是什么,应该是索引吧,怎样解决这个error?数据库是database desktop!!with updatedatamodule.Students_Table do
if locate('SNo',VarArrayOf([SpinEdit1.Text]),[LopartialKey])
then begin
delete;
edit1.text:='';
edit2.text:='';
edit3.Text:='';
showmessage('ɾ³ý³É¹¦!');
end else showmessage('Î޴˼Ǽ!');
end;

解决方案 »

  1.   

    message里面没想到复制粘后;begin
    with updatedatamodule.Students_Table do
    if locate('SNo',VarArrayOf([SpinEdit1.Text]),[LopartialKey])
    then begin
    delete;
    edit1.text:='';
    edit2.text:='';
    edit3.Text:='';
    showmessage('删除成功!');
    end else showmessage('无此记录!');
      

  2.   

    loPartialKey是部分匹配
    比如比如数据库里有KIIIIIIK,III,IIIIIII,IIII
    你要查询III,如果是loPartialKey,那么以上所有的值都回被查询出来,否则只查询出III
      

  3.   

    Table1.Locate('UserName',Edit1.Text,[loPartialKey]);
    实现部分匹配查询,即所谓的模糊查询,该查询也可以
    用Filter来实现