Hakan Subaşı
Hakan Subaşı

Reputation: 61

SQL Server 2005 query

I have a problem with my search. I want to explain shortly.

I insert new record sucsessfully to my employee table and I list this table from another form. Everything is ok. and also I see my record in SQL Server.

But in my list form I have search criteria for user search and list. I can see new record with using form onshow properties but my search sql does not show new records, only show old record.

Can anyone help me?

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;

Upvotes: 1

Views: 110

Answers (1)

Max
Max

Reputation: 7586

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?

Upvotes: 1

Related Questions