Link to home
Start Free TrialLog in
Avatar of tomcom
tomcom

asked on

DISTRIBUTED TRANSACTION HELP

I try to use disrtibuted transaction. First,I use MSDASQL successfull:

set XACT_ABORT on
set ANSI_NULL_DFLT_ON on
set ANSI_WARNINGS on
BEGIN DISTRIBUTED TRANSACTION
select * from OPENDATASOURCE('MSDASQL','DRIVER={SQL Server};SERVER=192.168.2.1;UID=sa;PWD=PASSWORD;').pubs.dbo.jobs
commit tran

Then I try to use SQLOLEDB, But failure:

set XACT_ABORT on
set ANSI_NULL_DFLT_ON on
set ANSI_WARNINGS on
BEGIN DISTRIBUTED TRANSACTION
select * from OPENDATASOURCE('SQLOLEDB','Data Source=192.168.2.1;User ID=sa;Password=PASSWORD').pubs.dbo.jobs
commit tran

I get the following error message:
The operation could not be performed because the OLE DB
provider 'SQLOLEDB' was unable to begin a distributed
transaction.
[OLE/DB provider returned message: New transaction cannot
enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a].



but I run the code use SQLOLEDB without DISTRIBUTED TRANSACTION success:

select * from OPENDATASOURCE('SQLOLEDB','Data Source=192.168.2.1;User ID=sa;Password=PASSWORD').pubs.dbo.jobs


WHY? Please help me!
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you need any more help with this question?