1

我的搜索有问题。我想简短地解释一下。

我成功地将新记录插入到我的员工表中,并从另一个表单中列出了该表。一切都好。我还看到了我在 SQL Server 中的记录。

但在我的列表表单中,我有用户搜索和列表的搜索条件。我可以使用表单 onshow 属性查看新记录,但我的搜索 sql 不显示新记录,只显示旧记录。

谁能帮我?

pl.Close;

pl.SQL.Clear;

pl.SQL.Add( 'select * from employee where active like ' +QuotedStr(statuscombo.Text+'%') +

                                          (' and name like ' +QuotedStr(name.Text+'%')     +
                                          (' and region like '+QuotedStr(region.Text+'%') +
                                          (' and subregionlike ' +QuotedStr(subregion.Text+'%') +
                                          (' and departman like ' +QuotedStr(dep.Text+'%') +
                                          (' and id like ' +QuotedStr(id.Text+'%'))))))) ;

pl.Open;
4

1 回答 1

1

Possible cause:

  • Maybe the new record have some NULL field so it get filtered out by your WHERE clause?
  • Or maybe the form you use to insert the new record doesn't update the DB?

Can you see your record in the table by using SQL Server Management Studio?

于 2013-05-02T08:43:49.660 回答