Linked server – updates to DB2(OLE DB prov.) fails | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Linked server – updates to DB2(OLE DB prov.) fails

We have an existing system, that was now migrated to a Consolidated SQL server environment. The old server was running on Windows 2000 with SQL2000 EE, SP3. New server has 5 instances of SQL2000 SE, SP3 running on Windows 2003. <br /><br />The specific system has a linked server setup to point to mainframe DB2, via OLEDB Provider, via CAE. I can’t seem to get the Linked Servers working again. It allows Reads and Writes, but not Updates. Gives following error: <br /> <br />OLE DB provider ‘MSDASQL’ could not UPDATE table ‘[MSDASQL]’ because of<br />column ‘ABC_CD’. The user did not have permission to write to the column. &gt; [OLE/DB provider returned message: Multiple-step OLE DB operation<br />generated errors. Check each OLE DB status value, if available. No work<br />was done.] <br />OLE DB error trace [OLE/DB Provider ‘MSDASQL’ IRowsetChange:<img src=’/community/emoticons/emotion-7.gif’ alt=’:S’ />etData<br />returned 0x80040e21 <br /><br />It is definitely NOT the DB2, or SQL server privileges that is insufficient. I also eliminated the CAE versions (old box, test and prod, was on V6.1.0.31 and new on<br />V7.1.0.40, but upgraded old box, and still works), and configurations. Also the SQL versions and SP-levels (there test box also on SE SP3). I created a new Linked Server and new Datasourse on one of there old boxes, and it works perfectly. If I do the exact same thing on the new server, it does not work. I compared auths, and even the entries in the sysservers and sysxlogins etc, and can’t see anything there either. <br /><br />I read the following articles: <br /><br /<a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm</a> /odbcproviderquery_based_updates.asp <br /<a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdrefodbcprovspec.asp>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdrefodbcprovspec.asp</a> <br /><br />According to all documentation on the OLE DB Provider for ODBC drivers (which we use in both the old and new environment), it indicates that cursor updates are not possible through OLE DB for ODBC. <br /><br />Here is the query that they are executing: <br /><br />UPDATE OPENROWSET <br /> ( <br /> ‘MSDASQL’, <br /> ‘DSN=DB2P;UID=abcdef<img src=’/community/emoticons/emotion-4.gif’ alt=’;P’ />WD=abcdef’, <br /> ‘ <br /> <br /> SELECT A_CD, DESC, B_CD, C_CD<br /> <br /> FROM ABCTB.TEST_TABEL <br /> WHERE A_CD = ”12345” <br /> <br /> ‘ <br /> ) <br /> SET B_CD = ’12’ <br /> , C_CD = ‘012’ <br /> , DESC = ‘#TESTING 123’ <br /> <br />There’s also indications that a registry key/switch exists to bypass a time-out issue(which they are also experiencing in the new environment). <br /><br />Article I read:<br /><br />Introduction to OLE DB <br /><br />OLE DB is a data access model from Microsoft. It uses the Component Object Model (COM) interfaces and, unlike ODBC, OLE DB does not assume that the data source uses a SQL query processor. <br /> <br />Adaptive Server Anywhere includes an OLE DB provider named ASAProv. This provider is ailable for current Windows and Windows CE platforms. <br /><br />You can also access Adaptive Server Anywhere using the Microsoft OLE DB Provider for ODBC (MSDASQL), together with the Adaptive Server Anywhere ODBC driver. <br /><br />Using the Adaptive Server Anywhere OLE DB provider brings several benefits: <br /><br />· Some features, such as updating through a cursor, are not available using the OLE DB/ODBC bridge. <br />· If you use the Adaptive Server Anywhere OLE DB provider, ODBC is not required in your deployment. <br />· MSDASQL allows OLE DB clients to work with any ODBC driver but does not guarantee that you can use the full range of functionality of each ODBC driver. Using the Adaptive Server Anywhere provider, you can get full access to Adaptive Server Anywhere features from OLE DB programming environments. <br /><br />Can anyone PLEASE help with advise!? <br />
]]>