s1:=query1.fieldbyname('szm').AsString; tbl_xdcf.Locate('XDCFBH',s1, [loPartialKey]);数据集名.Locate(字段名,关键值,[loPartialKey]);定位函数
DBGrid1.DataSource.DataSet.RecNo:=X;