With COM automatic transaction, the object support must be operated, use Access to call DTC, there will be inexplicable error code
Failedno Error Information Available: E_NOINTERFACE (0x80004002).
About this problem, Microsoft has a KB
http://support.microsoft.com/default.aspx?scid=kb;n-us;q221071&
DrawMoneyfroma (1000) DepostMoneyTob (1000) ContextUtil.setComplete () Return "OK!" Catch Exception ContextUtil.Setabort () Return "failed" EX.MESSAGE END TRY
END FUNCTION
Public Sub DrawMoneyFromA (ByVal amount As Long) 'to extract some money from the A Dim cnn As New OleDb.OleDbConnection (Me.OleDbConnection1.ConnectionString) cnn.Open () Dim cmd As New OleDb.OleDbCommand ( "Update bank set amount = Amount - "& Amount &" Where BankAccount = 'a' ", cnn) cmd.executenon query ()
End Sub
Public Sub DepostMoneyToB (ByVal amount As Long) 'B plus some money from Dim cnn As New OleDb.OleDbConnection (Me.OleDbConnection1.ConnectionString) cnn.Open () Dim cmd As New OleDb.OleDbCommand ( "Update bank set amount = amount "& Amount &" Where BankAcount = 'b' ", CNN) 'Throw New Exception (" ff ") cmd.executenonquery ()
End Sub