开发者

Microsoft ODBC For Oracle with TransactionScope

I use Microsoft ODBC For Oracle, and process a distributed transaction with TransactionScope, but, the code throws a error: ERROR [HYC00][ORACLE][ODBC]option not implement, my code is in vb.net.

Here is my code:

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 开发者_如何学Cas 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

who can tell me why, thanks.


This may not be your problem, but I never use the Microsoft Oracle driver. I always use the Oracle driver, also known as the Oracle Instant Client. You can get it here.


Please be more specific. Like where is connection object. Please put the entire class file code. It seems some problem with connection object. Paste the entire code so that we can provide you exact solution

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜