Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error being raised With COM+
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00528556
Message ID:
00529768
Views:
9
I dont think any COM Server is "better suited" For ComReturnError(), but again i maybe wrong!, Let me take the RecordSet Example and turn it into a Dbf example without MTS
DEFINE CLASS MyClass As Session OlePublic

  Function SaveMyWork()

   USE SomeTable IN 0 
   USE SomeOtherTable IN 0 
   =CursorSetProp("Buffering", 5, "SomeTable")
   =CursorSetProp("Buffering", 5, "SomeOtherTable")

   REPLACE SomeTable.SomeField WITH "This Comment" IN SomeTable
   REPLACE SomeOtherTable.SomeField WITH "This Comment" IN SomeOtherTable

   BEGIN TRANSACTION
     llOK=TableUpdate(2, .F., "SomeTable") 
  
    x = y && This causes an error and causes the program to stop executing because the error method call ComReturnError()

    *-- At this point the control is given back to the client
    *-- The END TRANSACTION Was not call so we have a cursor open with 
    *-- Still uncommited changes, by quitting at this point it is almost 
    *-- Impossible to predict the results but i can assure you will be getting a C5 

     llOK=IIF(llOK, TableUpdate(2, .F., "SomeOtherTable"), .F. )


   IF llOK
     END TRANSACTION
   ELSE
     ROLLBACK
   ENDIF

  ENDFUNC

  **-- Some more functions here including a error function with ComReturnError()

ENDDEFINE
>Thanks for sharing all of this info. Our setup is different since we aren't using MTS and COM+ and we are just using dbfs - so it's probably better suited to ComReturnError.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform