Re: Checking Tadoquery for changes



Ok,

I think we are thinking about this on seperate paths here... Think of a word document, when you open MS Word and you get a blank screen its already in "Edit" Mode if you will. The same goes with my program, the user brings up the input form and its automatically in Insert. So checking the state of the query would be sort of redundant because it will always be in edit mode.

I know in vb there is like a 'haschanges" boolean on the query, but thats good ole ADO.Net and well I have to use vcl/win32 for this app.

The only thing I can think of is check the required fields to see if they are all null?

Josh



Vu Quang Thang wrote:
Is there anyway I can check a query for changes?

Reason being, I don't want to prompt the user to save the information on the form close if the data has not been modified or is blank.



Hi,

I think we can check the status of the ADODataset when close form. May be like this
FormCloseQuery(....)
begin
if ADODataset.State in [dsEdit,dsInsert] then
if MessageDlg('Save change?',mtConfirmation,[mbYes,mbNo],0) = mrYes then
ADODataset.Post
else
ADODataset.Cancel;
end;


Thang


.



Relevant Pages

  • Re: Checking Tadoquery for changes
    ... > word document, when you open MS Word and you get a blank screen its ... > user brings up the input form and its automatically in Insert. ... > checking the state of the query would be sort of redundant because it will ... > always be in edit mode. ...
    (borland.public.delphi.database.ado)
  • Re: Merging data from Access Query
    ... merged into a word document, I get the SQL message about merging data into ... I have re-established the links from the query to the table fields, ... the SQL information inside of word to make sure everything is right for the ... to merge the fields from the access database query, ...
    (microsoft.public.word.mailmerge.fields)
  • Re: mailmerging multiple tables from access in one word-document: how?
    ... >A query would seem likely but there I have a problem. ... >knows 8 languages ... Sending the Current Record to Word with Automation ... Access a database and insert into a Word document the data that you find ...
    (microsoft.public.access.externaldata)
  • Waiting for MSAccess to execute DDE commands
    ... Excel and Access and the Word mail merge document just hangs. ... Can you convert the query to a make table query and then use that table as ... > When I open the Word document, Access opens and I get the login screen for ... > I have moved both the Access database and Word document to my local drive ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Automate opening a merge with Mailmerge Recipients open
    ... > posted twice. ... How are you trying to modify the query before opening the Word document? ... So now what I would like to do is just bring up the merge document with the full list of recipients and have the "Merge Recipients" window open so the end user can refine their list from Word instead of from my interface. ...
    (microsoft.public.word.mailmerge.fields)