我使用Microsoft ODBC for Oracle,並使用TransactionScope處理分佈式事務,但代碼拋出錯誤:錯誤[HYC00] [ORACLE] [ODBC]選項未實現,我的代碼位於vb.net。用於Oracle的Microsoft ODBC與TransactionScope
這裏是我的代碼:
sub Main()
dim strConn1 as string = "Driver={Microsoft ODBC for Oracle};Server=server1;UID=user1;PWD=pwd1;"
dim strConn2 as string = "Driver={Microsoft ODBC for Oracle};Server=server2;UID=user2;PWD=pwd2;"
try
using scope as new TransactionScope()
using conn1 as new OdbcConnection(strConn1)
conn1.Open() 'always throws error here
dim command1 as new OdbcCommand(strSQL1)
command1.ExecuteNonQuery()
using conn2 as new OdbcConnection(strConn2)
dim command2 as new OdbcCommand(strSQL2)
command2.ExecuteNonQuery()
end using
end using
scope.Complete()
end using
catch
end try
end sub
誰可以告訴我爲什麼,謝謝。
嗨AmRan,我修改了我的代碼。謝謝 – viscroad