MFC DAO - database update notifications...

MFC DAO - database update notifications...

Post by Tom Spilma » Sat, 02 May 1998 04:00:00



    I'm trying to find a way to get database update notifications from
inside my mfc app.  Multiple users will be using this app on a network with
a shared mdb file.  I want to keep all the apps insync with each other.
I've tried checking the file's last modified time, but that doesn't seem to
work.  I think the network doesn't register the file as modified until the
file is closed.  Next i tried using the
CDaoRecordset::GetLastModifiedBookmark() but it never sees the updates done
by other users.  Is there something i'm missing?  Thanks...

Tom Spilman
Dalco Athletic Lettering

 
 
 

MFC DAO - database update notifications...

Post by John Cornel » Sat, 02 May 1998 04:00:00


You would probably have to Requery the recordset before
GetLastModifiedBookmark() will find anything.  But then again, the Requery
would get the changes made by the other users and you would no longer need
to use GetLastModifiedBookmark().   Otherwise you would need to develop
some type of message passing between each instance of the application.



>     I'm trying to find a way to get database update notifications from
> inside my mfc app.  Multiple users will be using this app on a network
with
> a shared mdb file.  I want to keep all the apps insync with each other.
> I've tried checking the file's last modified time, but that doesn't seem
to
> work.  I think the network doesn't register the file as modified until
the
> file is closed.  Next i tried using the
> CDaoRecordset::GetLastModifiedBookmark() but it never sees the updates
done
> by other users.  Is there something i'm missing?  Thanks...

> Tom Spilman
> Dalco Athletic Lettering



 
 
 

MFC DAO - database update notifications...

Post by Peter Chama » Sun, 03 May 1998 04:00:00


Tom,

The average application does a query first to get the results from the
database without holding open the recordset.  Then after sometime, the user
updates the information and then the application creates a new recordset and
updates the database.  So the question is for your applicaiton, are you
looking for notificaiton between the Edit() and Update() or the longer
period of the initial query to display the information and the 2nd query?


>    I'm trying to find a way to get database update notifications from
>inside my mfc app.  Multiple users will be using this app on a network with
>a shared mdb file.  I want to keep all the apps insync with each other.
>I've tried checking the file's last modified time, but that doesn't seem to
>work.  I think the network doesn't register the file as modified until the
>file is closed.  Next i tried using the
>CDaoRecordset::GetLastModifiedBookmark() but it never sees the updates done
>by other users.  Is there something i'm missing?  Thanks...

>Tom Spilman
>Dalco Athletic Lettering


 
 
 

MFC DAO - database update notifications...

Post by Tom Spilma » Tue, 05 May 1998 04:00:00


Quote:>As John Cornell wrote

    >You would probably have to Requery the recordset before
    >GetLastModifiedBookmark() will find anything.  But then again, the
Requery
    >would get the changes made by the other users and you would no longer
need
    >to use GetLastModifiedBookmark().   Otherwise you would need to develop
    >some type of message passing between each instance of the application.

    I'm trying to keep the apps insync with each other, without unnecessary
screen updates, and requerys.  By the responses I've gotten it seems that
there is no built in mechanism for this, such as asking the database when it
was last modified.  What kind of network traffic does a requery take???

    So I believe that during my OnIlde call I will requery the records.  An
use the GetLastModifiedBookmark, call to figure if something has changed.
If something has i will make 2 passes at the list control.  First
adding\updating newer items and second deleting old items.  Updates could
still fall thur the cracks though....  but this should do... I could also
put it in another thread and protect the database object with a mutex.
Thanks for the help....

Tom Spilman
Dalco Athletic Lettering

 
 
 

1. Retrieving updated information only from MS Access Database w/ MFC DAO

I have an access database that is updated and appended to by a third-party
software application. I need to retrieve only the new or changed records on
this database.
How do I query the database tables through my CDaoRecordSet derived classes
to retrieve only those records that are new or changed?

-tg

2. help with normal installation manual

3. Does ODBC/DAO provide update notifications?

4. database

5. Can't update external table, connecting with MFC DAO

6. Paradox's service and upgrade program

7. Calling DAO directly from MFC DAO classes

8. FileMaker Pro Developer Edition i CD FileMaker - Tips & Tricks

9. MFC DAO or DAO SDK.

10. mfc dao vs. dao sdk

11. Help:Database programming using MFC DAO

12. Access workgroup databases and DAO MFC

13. Multiple apps accessing the same database (DAO + MFC)