Hello Everyone,
I’m creating a simple web application in php with SQL 2005 as the backend server. Within SQL I’ve created a linked server to an AS/400 which is supposed to be updated at the end of the stored procedure. However, everything works fine until the procedure tries to insert a record into the linked server; at that point I get the following error.
I’ve looked all over the place and I’ve found a fair amount of help with linked servers. Some of the posts/websites have gotten me closer, but so far I haven’t been able to solve this error, so any help would be appreciated!
Just as an fyi, here's the code that's throwing the error:
I’m creating a simple web application in php with SQL 2005 as the backend server. Within SQL I’ve created a linked server to an AS/400 which is supposed to be updated at the end of the stored procedure. However, everything works fine until the procedure tries to insert a record into the linked server; at that point I get the following error.
I’ve looked all over the place and I’ve found a fair amount of help with linked servers. Some of the posts/websites have gotten me closer, but so far I haven’t been able to solve this error, so any help would be appreciated!
Code:
ERROR RETRURNED BY SQL:
OLE DB provider "MSDASQL" for linked server "LS_AS400" returned message "[COLOR=red][IBM][iSeries Access ODBC Driver]Enlist with DTC phase failed. 2[/color]".
Msg 7391, Level 16, State 2, Procedure srgsp_LEAN_StatusCheck, Line 101
"[COLOR=red]The operation could not be performed because OLE DB provider "MSDASQL" for linked server "LS_AS400" was unable to begin a distributed transaction.[/color]"
Just as an fyi, here's the code that's throwing the error:
Code:
IF (@ReturnVal) = '106'
BEGIN
EXEC (
'INSERT INTO My400Lib.My400File
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)',
@C1,
@C2,
@C3,
@C4,
@C5,
@C6,
@C7,
@C8,
@C9,
@C10,
@C11,
@C12,
@C13
)
AT LS_AS400
END