Re: Design question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: CJ Taylor (youalreadyknowit_at_itsoneverylistintheworld.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 01:43:58 GMT

Nevermind... bad idea.

"CJ Taylor" <nospam@blowgoats.com> wrote in message
news:103q50g871gk32c@corp.supernews.com...
> if your using DataAdapters (properly) you can catch the RowUpdated Event
and
> see if it was successful or not...
>
> if it wasnt, you can get the new value by retreviing it from the
database...
>
> [excerpt from David Sceppa's book]
> <code>
> Private Sub HandleRowUpdated (byval sender as object, e as _
> OleDbRowUpdatedEventArgs)
>
> If e.Status = UpdateStatus.ErrorsOccurred AndAlso _
> TypeOf(e.Errors) is DBConcurrencyException then
>
> ConflictAdapter.SelectCommand.Parameters(0).Value = e.Row("ID")
> Dim intRowsReturned as Integer
> intRowsReturned = ConflictAdapter.Fill(ConflictDataset)
> if intRowsreturned = 1 then
> e.Row.RowError = "The row has been modified by another user"
> 'CJ's note: Here you can do a bunch of stuff saying what
> actually changed
> else
> e.Row.RowError = "The row no longer exists in database"
> end if
> e.Status = UpdateStatus.Continue
> end if
> End sub
>
> hope it helps
> CJ
>
>
> End Sub
> </code>
> "Ruslan Shlain" <rshlain@hotmail.com> wrote in message
> news:OZJC1L%23%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> >
> > Hello Everyone,
> > Looking for a better way to do this.
> >
> > I have several separate processes running on 5 + machines on the
network.
> > These processes are identical. What they do is, they look at a table in
> the
> > DB and based on entries they perform some tasks.Once entry is read it
> > changes a status. My problem consits of the following. If 2 processes
read
> > an entry from the table at the same time and one of them changes it
status
> > and then the other comes in and changes same entry they both will be
> working
> > on the same task. Is there a way that i can force "something ", so that
> > above scenerio happens 2 of my processes do not work on the same entry.
> > --
> > Ruslan Shlain
> > nAlliance Corporation
> > www.nAlliance.com
> >
> >
>
>



Relevant Pages

  • Re: Field validation does not kick in
    ... I only just require to check and increment the if there is another ... I generally use the forms BeforeUpdate event to trap for data entry errors. ... This event fires before the data is actually written, and has a Cancel ... Private Sub Form_BeforeUpdate ...
    (microsoft.public.access.formscoding)
  • Re: Using Validation to force entry into cells?
    ... Uh oh...I run into a problem now with every copy of this worksheet. ... Private Sub Worksheet_Change ... > Option Explicit ... >> entry into this column in our form. ...
    (microsoft.public.excel.misc)
  • Re: Creating a New Record in Sub Form_Current
    ... any attempt to use Form_Current to force the entry of a new record is ... > required to determine whether the first record is already complete. ... > code is run in Sub Form_Open or Sub Form_Load. ... This conditional interlocking generally works well. ...
    (microsoft.public.access.forms)
  • Re: event fire
    ... 'J' is entered Then to subtract 10.00 from entry and copy the entrys in cells ... Private Sub Workbook_SheetChange ... Dim dblValue As Double ... Dim varTargetAmt As Variant ...
    (microsoft.public.excel.programming)
  • Entry.cs // A common EntryPoint for a project.
    ... /// Main Entry Point. ... Public Sub New ... excel workbook, sheet. ... microsoft Excel object lib 9, 10, 11, etc via the Project Add Reference ...
    (microsoft.public.dotnet.languages.csharp)