Using TCommand to update records. Changes not seen.
Posted: Tue 28 Nov 2006 19:05
Hi,
I am writing an app that displays information about contractors currently on site. It is all working fine with one exception.
When a contractor comes on site their onsite status is change from "No" to "Yes". The statement I use is;
sqlstatement := 'UPDATE ' + suppliertable + ' SET OnSiteNow = ''' + onsitenow + ''' WHERE (EmployeeFirst=''' + firstname +
''' and EmployeeLast=''' + lastname + ''')';
employeeupdate.sql.Clear;
employeeupdate.sQL.add(sqlstatement);
employeeupdate.Execute();
The update is working because I can go into another application and see the change. In the app that made the change I can not see it. I destroy all controls and lists and stuff and do a full new query using tmyquery and the change is not there. If I exit the application and reload it is there.
I have tried this with autocommit on and off.
Are the changes cached somewhere, can I force them to be written. Why does this app not see the change, but I can load another program to look at the table and the changes are made. In this app I load another table, go back to this one and still no changes. I have to exit and reload the app for the changes to be seen.
Craig
I am writing an app that displays information about contractors currently on site. It is all working fine with one exception.
When a contractor comes on site their onsite status is change from "No" to "Yes". The statement I use is;
sqlstatement := 'UPDATE ' + suppliertable + ' SET OnSiteNow = ''' + onsitenow + ''' WHERE (EmployeeFirst=''' + firstname +
''' and EmployeeLast=''' + lastname + ''')';
employeeupdate.sql.Clear;
employeeupdate.sQL.add(sqlstatement);
employeeupdate.Execute();
The update is working because I can go into another application and see the change. In the app that made the change I can not see it. I destroy all controls and lists and stuff and do a full new query using tmyquery and the change is not there. If I exit the application and reload it is there.
I have tried this with autocommit on and off.
Are the changes cached somewhere, can I force them to be written. Why does this app not see the change, but I can load another program to look at the table and the changes are made. In this app I load another table, go back to this one and still no changes. I have to exit and reload the app for the changes to be seen.
Craig