0

this statments work under V6R1 but not under V7R1 with an ODBC linked server in an SQL Server 2012

select * from AS400.AS400.LIB.TAB

SQL Managment Studio thrown the error:

Cannot process the object "AS400.LIB.TAB". The OLE DB provider "IBMDASQL" for linked server "AS400" indicates that either the object has no columns or the current user does not have permissions on that object. [SQLSTATE 42000] (Error 7357). The step failed.

Do somebody have an idea to fix this problem?

regards Jo

JJANSSEN
  • 171
  • 1
  • 6

3 Answers3

2
EXEC ('SELECT * FROM LIB.TAB') AT AS400

and if calling a stored procedure that returns data:

EXEC ('{CALL LIB.SP_TEST(?,?,?)}', 'Data', 'Data2', 'Data3') at AS400
Stephen R.
  • 21
  • 5
0

i found a solution

select * from OPENQUERY(AS400,'SELECT * FROM LIB.TAB')
JJANSSEN
  • 171
  • 1
  • 6
0

FWIW, I was getting this same error message along with a SQL7008 error code returned from the AS/400 whenever my code attempted to execute an UPDATE statement. While investigating, I found this article, http://www-01.ibm.com/support/docview.wss?uid=swg21007161, which led me to discover that journaling had been turned off earlier for the table in question due to scheduled upgrade to our ERP system and was never turned back on afterwards. Once journaling was turned back on, my updates began working again.

PongGod
  • 829
  • 1
  • 11
  • 19