viscroad
viscroad

Reputation: 1

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 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

who can tell me why, thanks.

Upvotes: 0

Views: 755

Answers (2)

DCookie
DCookie

Reputation: 43523

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.

Upvotes: 1

user240141
user240141

Reputation:

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

Upvotes: 0

Related Questions