Results 1 to 5 of 5

Thread: It seems absurd... (DB question)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325

    It seems absurd... (DB question)

    But I can't get an error . Yes, I want the DBConcurrency error, but I can't get it! When I establish two different connection with a database, make the same query, modify the data with different values and try to update, I get no error.
    Why? Are the two different connections?

    Help, please... Thx
    Learn, this is the Keyword...

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Did you add the dataadapter at desing time? if so did you checked 'Use Optimistic Concurrency' ?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Do this. Start the program twice, then get the data from both programs. Change and update one program, then change and update the second program. You should get an error. I did a project to produce a DBConcurrency exception, and I did it like the above.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325
    I did this:
    VB Code:
    1. dim Da1 as OleDbDataAdapter
    2. dim Da2 as oleDbDataAdapter
    3. dim ds1 as DataSet
    4. dim ds2 as DataSet
    5.  
    6. Da1 = New OleDbDataAdapter(TheSameQuery, myConnection)
    7. Da2 = New OleDbDataAdapter(TheSameQuery, myConnection)
    8.  
    9. Da1.Fill(ds1,mytable)
    10. Da2.Fill(ds2,mytable)
    11.  
    12. ds1.tables(0).rows(0)(0)=10
    13. ds2.tables(0).rows(0)(0)=15
    14.  
    15. da1.Update(ds1,mytable)
    16. da2.update(ds2,mytable) ' Here's where I GET the error
    In the code above I GET the error, but since I'm remoting this object, I can't use these lines don't know why:
    VB Code:
    1. Da1 = New OleDbDataAdapter(TheSameQuery, myConnection)
    2. Da2 = New OleDbDataAdapter(TheSameQuery, myConnection)
    To make it working I had to change in:
    VB Code:
    1. Da1 = New OleDbDataAdapter(TheSameQuery, myConnectionString) 'Instead of myConnection
    2. Da2 = New OleDbDataAdapter(TheSameQuery, myConnectionString) 'Instead of myConnection
    Now I DON'T GET the error... Please try...
    Learn, this is the Keyword...

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325

    *** BUMP ***

    Anyone, please?

    Thx...
    Learn, this is the Keyword...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width