Hello
First of all the information about my test system:
DBMS: MSSQL 2005 with SP3
Compiler: Delphi 2009
OS: Windows Vista Ultimate and Windows XP Pro
Case example:
I have written a application with TUniConnection (connected to MSSQL 2005 database), TUniQuery (connected to TUniConnection and SQL property with SQL syntax to needed table) and TSQLServerUniProvider. There is also a DBGrid on the application form which shows the content of the resultset of the TUniQuery connected via TDataSource.
What i want to do now is that when User A works on another PC than me (User B) and we both have a connection to the same table, then when User A changes one record i want that the record is locked for any other user (e.g. User B) as long as User A has not posted the changes or canceled it. And the other thing is when User A post his changes i want that User B could see automatically the changes of the record.
Hope someone could help me out and point me into the right direction. Or it would be great if someone could send me a demo application or maybe inform me which demo application of UniDAC does the case example above.
Thanks a lot for your help in advance!
HELP: MSSQL LockType and CursorType
You can enable locking of the records that are being edited by setting the LockMode property of TUniQuery to lmPessimistic.
Set roBeforeEdit in RefreshOptions. Record will be refreshed when you call Edit. So a user will always see actual data when editing a record. You can also call the Refresh method periodically using the TTimer component.
Set roBeforeEdit in RefreshOptions. Record will be refreshed when you call Edit. So a user will always see actual data when editing a record. You can also call the Refresh method periodically using the TTimer component.