On Thu, 13 Mar 2014, Nathan Wild wrote:

Thanks so much for responding!  I am extremely excited about the prospect of 
getting this working.
Nothing I do in databound controls seems to commit anything to the underlying 
dataset.

If I open a connection, activate a TSQLQuery with 'SELECT * FROM AnyTable', 
connect it toa dbgrid, etc.  I can delete rows,
edit data etc. and it appears to work normally.  Changes take effect inside the 
controls, values change in the dataset,
etc. but as soon as I disconnect and reconnect the dataset all my changes are 
reverted.

  ODBCConnection1.Connected := TRUE;
  SQLQuery1.SQL.Clear();
  SQLQuery1.SQL.Append('SELECT * FROM AnyTable');
  SQLQuery1.Active := TRUE;
  SQLQuery1.Delete();
  SQLQuery1.Edit();
  SQLQuery1['AnyField'] := 'CHANGED';
  SQLQuery1.Post();

All of these changes take place in the UI.  i.e. the first row is deleted and 
the field is modified in the second.  As soon
as I close and re-open the table, both changes are undone.

You must call applyupdates. Post only modifies the in-memory copy of the data, but doesn't actually execute any queries on the database.
Only when you call ApplyUpdates(), the SQL will be executed to update the 
database.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to