Microsoft ODBC For Oracle 与 TransactionScope
我使用Microsoft ODBC For Oracle,并使用TransactionScope处理分布式事务,但是,代码抛出错误:错误[HYC00][ORACLE][ODBC]选项未实现,我的代码在vb.net中。
这是我的代码:
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
谁能告诉我为什么,谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能不是你的问题,但我从不使用 Microsoft Oracle 驱动程序。我总是使用 Oracle 驱动程序,也称为 Oracle Instant Client。您可以在此处获取。
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