All or nothing queries...

Results 1 to 3 of 3

Thread: All or nothing queries...

  1. #1
    Tudor Holton Guest

    Default All or nothing queries...

    I&#039m trying to create an ASP site that uses a method similar to a banking system. e.g. If I take $2 out of Account A and then put it into Account B it should all tally up. How do I write a query that says, either both occur, or none occur?<BR><BR>For example, if I took the $2 out of Account A, and then the script stopped for some reason, then the money wouldn&#039t have tallied up. There&#039d be $2 missing.<BR><BR>I can&#039t use post-checking (by SELECTing afterwards to make sure the operation occured) because I can&#039t guarantee that it will get to that point in the script.<BR><BR>Does anyone know how to do this?<BR><BR>Cheers,<BR>Tudor

  2. #2
    Steve Cimino Guest

    Default This is what MTS was designed for

    Search on how to use MTS. Basically, MTS will roll back the transaction if there was an error somewhere. It&#039s a little more involved in designing, and creates a bit of overhead, but certainly worth it if you&#039re dealing with money (esp if it&#039s my money!)

  3. #3
    Tudor Holton Guest

    Default RE: Added twist - Access

    Thanks Steve. I had a look. But it seems not to work with Access. I could be wrong, but it says that MS-Access does not support Distributed Transactions.<BR><BR>I can&#039t use SQL server because my web host provider charges $20 every time I wish to change the database. And I can&#039t develop on my system first because I don&#039t have MS-SQL server because it&#039s kinda expensive and I&#039m a student.<BR><BR>Your help is much appreciated.<BR><BR>Cheers,<BR>Tudor.

Posting Permissions

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