Discussion:
Linked server to as400 - for the love of god please help.
(too old to reply)
Ian Boyd
2004-08-21 23:12:41 UTC
Permalink
i'm trying to setup a linked server between SQL Server and an AS400/DB2/IBM
pos database.

There is an ODBC DSN on the server machine. Creating a linked server using
MSDASQL, and then querying for data, i (sometimes) get one row of data, then
the error:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].


So i instead create a linked server using IBM's own OLEDB provider.

When i query using 4 part notation:
select * from sass400...CSPCM

i get the error:

Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME ORDINAL=-1],
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].


When i query using OPENQUERY notation
select * from openquery(sass400, 'select * from cspcm')

i get the error

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in CMSODBC type *FILE not
found.
Cause . . . . . : CSPCM in CMSODBC type *FILE was not found. If this is an
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name and
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup with
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].

i can view the tables and views of the ODBC linked server, and get things
like the following:
Name: CSPCM
Schema: CMS73DTA
Catalog: WC400B

If i try to view the tables and views of the OLEDB linked server, Enterprise
Manager locks up.

So i fiddling with my openquery notation and 4 part notation, using the
values above (CMS73DTA, WC400B)
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB provider
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from cms73dta.cspcm'].
select * from openquery(sass400, 'select * from wc400b.cspcm')
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in WC400B type *FILE not
found.
Cause . . . . . : CSPCM in WC400B type *FILE was not found. If this is an
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name and
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup with
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].
select * from openquery(sass400, 'select * from wc400b.cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from wc400b.cms73dta.cspcm'. The OLE DB
provider 'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from wc400b.cms73dta.cspcm'].
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB provider
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from cms73dta.cspcm'].
select * from sass400.wc400b.cms73dta.cspcm
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'IBMDA400'. A
four-part name was supplied, but the provider does not expose the necessary
interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
select * from sass400..cms73dta.cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME ORDINAL=-1],
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].
select * from sass400...cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME ORDINAL=-1],
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].
select * from ballycms...cspcm
[one row of data]
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].

And yet, using ADO and the existing DSN, i can query and retrieve data fine.
Why can't SQL Server using ODBC work as well as ADO using ODBC?


i've been fighting with this for 3 months now - i just want data from an
ODBC source.

And then it hits you, you're so tired of IBM.
Pike
2004-08-22 02:29:09 UTC
Permalink
Besides MS kb, google comp.databases.ibm-db2.

Maybe check out:
StarSQL 5.1
http://www.starquest.com/Productfolder/starsql.html

There are other drivers out there too.

Good luck,

RAC v2.2 and QALite @
www.rac4sql.net
Ian Boyd
2004-08-22 02:53:52 UTC
Permalink
i need to beat someone in IBM to death, preferably with Mag-Lite flashlight.


i'm soooo tired of IBM.
Pike
2004-08-22 13:28:30 UTC
Permalink
In *comp.databases.ibm-db2* there are always IBM guys
from the Toronto labs on line.Post with the
-for the love of god please help-
line and I'm sure you'll get their attention.
Their usually very good:)
Townie G
2004-09-09 15:23:52 UTC
Permalink
We've had similar nightmares here... and found out that depending on how
you are accessing your AS/400, it's randomly case sensitive and your
queries must be IN UPPERCASE!

God be with you as you fight the black beast!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Rob Sutton
2004-09-27 16:51:39 UTC
Permalink
I ran into same problem. I found instead of using linked server, just
use OPENROWSET with dsnless and linked serverless query, had all of the
same problems you had until I put this together with bits and pieces
gathered:



/*USES IBM CLIENT ACCESS ODBC DRIVER: */

SELECT * FROM OPENROWSET ('MSDASQL',
'Driver=Client Access ODBC Driver
(32-bit);Uid=youruserid;Pwd=yourpassword;System=ipaddressorsystemname;DB
Q=databaselibrary;CMT=0;NAM=0;
DFT=0;DSP=0;TFT=0;TSP=0;DEC=0;XDYNAMIC=1;RECBLOCK=1;BLOCKSIZE=8;SCROLLAB
LE=1;TRANSLATE=0;LAZYCLOSE=0;LIBVIEW=0;
REMARKS=0;CONNTYPE=0;SORTTYPE=0;PREFETCH=0;DFTPKGLIB=QGPL;LANGUAGEID=ENU
;SORTWEIGHT=0;MAXFIELDLEN=32;COMPRESSION=0;
ALLOWUNSCHAR=0;SEARCHPATTERN=1;MGDSN=0',

'
SELECT * FROM myas400_table
')

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Steve Kass
2004-08-22 04:39:56 UTC
Permalink
Ian,

See if this is at all related:

http://groups.google.com/groups?threadm=ukfmn4%23aEHA.2544%40TK2MSFTNGP10.phx.gbl

Steve Kass
Drew University
Post by Ian Boyd
i'm trying to setup a linked server between SQL Server and an
AS400/DB2/IBM
Post by Ian Boyd
pos database.
There is an ODBC DSN on the server machine. Creating a linked server using
MSDASQL, and then querying for data, i (sometimes) get one row of data, then
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].
So i instead create a linked server using IBM's own OLEDB provider.
select * from sass400...CSPCM
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].
When i query using OPENQUERY notation
select * from openquery(sass400, 'select * from cspcm')
i get the error
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in CMSODBC type *FILE not
found.
Cause . . . . . : CSPCM in CMSODBC type *FILE was not found. If this is an
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name and
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup with
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].
i can view the tables and views of the ODBC linked server, and get things
Name: CSPCM
Schema: CMS73DTA
Catalog: WC400B
If i try to view the tables and views of the OLEDB linked server, Enterprise
Manager locks up.
So i fiddling with my openquery notation and 4 part notation, using the
values above (CMS73DTA, WC400B)
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB provider
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from cms73dta.cspcm'].
select * from openquery(sass400, 'select * from wc400b.cspcm')
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in WC400B type *FILE not
found.
Cause . . . . . : CSPCM in WC400B type *FILE was not found. If this is an
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name and
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup with
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].
select * from openquery(sass400, 'select * from wc400b.cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from wc400b.cms73dta.cspcm'. The OLE DB
provider 'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from wc400b.cms73dta.cspcm'].
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB provider
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to process
object, since the object has no columnsProviderName='IBMDA400', Query=select
* from cms73dta.cspcm'].
select * from sass400.wc400b.cms73dta.cspcm
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'IBMDA400'. A
four-part name was supplied, but the provider does not expose the necessary
interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
select * from sass400..cms73dta.cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].
select * from sass400...cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more columns of
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID ORDINAL=-1]].
select * from ballycms...cspcm
[one row of data]
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].
And yet, using ADO and the existing DSN, i can query and retrieve data fine.
Why can't SQL Server using ODBC work as well as ADO using ODBC?
i've been fighting with this for 3 months now - i just want data from an
ODBC source.
And then it hits you, you're so tired of IBM.
Ian Boyd
2004-08-22 11:14:37 UTC
Permalink
Nope.

And that's when it hit's you. You are SO tired of IBM.
Post by Steve Kass
Ian,
http://groups.google.com/groups?threadm=ukfmn4%23aEHA.2544%40TK2MSFTNGP10.phx.gbl
Post by Steve Kass
Steve Kass
Drew University
Post by Ian Boyd
i'm trying to setup a linked server between SQL Server and an
AS400/DB2/IBM
Post by Ian Boyd
pos database.
There is an ODBC DSN on the server machine. Creating a linked server using
MSDASQL, and then querying for data, i (sometimes) get one row of data,
then
Post by Ian Boyd
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
returned
Post by Ian Boyd
0x80004005: ].
So i instead create a linked server using IBM's own OLEDB provider.
select * from sass400...CSPCM
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
When i query using OPENQUERY notation
select * from openquery(sass400, 'select * from cspcm')
i get the error
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in CMSODBC type *FILE
not
Post by Ian Boyd
found.
Cause . . . . . : CSPCM in CMSODBC type *FILE was not found. If this
is
Post by Steve Kass
an
Post by Ian Boyd
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name
and
Post by Ian Boyd
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup
with
Post by Ian Boyd
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].
i can view the tables and views of the ODBC linked server, and get things
Name: CSPCM
Schema: CMS73DTA
Catalog: WC400B
If i try to view the tables and views of the OLEDB linked server,
Enterprise
Post by Ian Boyd
Manager locks up.
So i fiddling with my openquery notation and 4 part notation, using the
values above (CMS73DTA, WC400B)
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB
provider
Post by Ian Boyd
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from cms73dta.cspcm'].
select * from openquery(sass400, 'select * from wc400b.cspcm')
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in WC400B type *FILE not
found.
Cause . . . . . : CSPCM in WC400B type *FILE was not found. If this is
an
Post by Ian Boyd
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name
and
Post by Ian Boyd
try the request again. If the object is a node group, ensure that the DB2
Multisystem product is installed on your system and create a nodegroup
with
Post by Ian Boyd
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL error ]
OLE DB error trace [OLE/DB Provider 'IBMDA400' ICommandPrepare::Prepare
returned 0x80004005: ].
select * from openquery(sass400, 'select * from
wc400b.cms73dta.cspcm')
Post by Steve Kass
Post by Ian Boyd
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from wc400b.cms73dta.cspcm'. The OLE DB
provider 'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from wc400b.cms73dta.cspcm'].
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB
provider
Post by Ian Boyd
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from cms73dta.cspcm'].
select * from sass400.wc400b.cms73dta.cspcm
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'IBMDA400'. A
four-part name was supplied, but the provider does not expose the
necessary
Post by Ian Boyd
interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
select * from sass400..cms73dta.cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
select * from sass400...cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
select * from ballycms...cspcm
[one row of data]
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
returned
Post by Ian Boyd
0x80004005: ].
And yet, using ADO and the existing DSN, i can query and retrieve data
fine.
Post by Ian Boyd
Why can't SQL Server using ODBC work as well as ADO using ODBC?
i've been fighting with this for 3 months now - i just want data from an
ODBC source.
And then it hits you, you're so tired of IBM.
Uri Dimant
2004-08-22 12:24:36 UTC
Permalink
Ian
We have installed the client access on the SQL Server and then by using DTS
we get the data from AS400.

I agree, that creates some problems.
Post by Ian Boyd
Nope.
And that's when it hit's you. You are SO tired of IBM.
Post by Steve Kass
Ian,
http://groups.google.com/groups?threadm=ukfmn4%23aEHA.2544%40TK2MSFTNGP10.phx.gbl
Post by Ian Boyd
Post by Steve Kass
Steve Kass
Drew University
Post by Ian Boyd
i'm trying to setup a linked server between SQL Server and an
AS400/DB2/IBM
Post by Ian Boyd
pos database.
There is an ODBC DSN on the server machine. Creating a linked server
using
Post by Steve Kass
Post by Ian Boyd
MSDASQL, and then querying for data, i (sometimes) get one row of data,
then
Post by Ian Boyd
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC
Driver
Post by Steve Kass
Post by Ian Boyd
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
returned
Post by Ian Boyd
0x80004005: ].
So i instead create a linked server using IBM's own OLEDB provider.
select * from sass400...CSPCM
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
When i query using OPENQUERY notation
select * from openquery(sass400, 'select * from cspcm')
i get the error
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in CMSODBC type *FILE
not
Post by Ian Boyd
found.
Cause . . . . . : CSPCM in CMSODBC type *FILE was not found. If this
is
Post by Steve Kass
an
Post by Ian Boyd
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name
and
Post by Ian Boyd
try the request again. If the object is a node group, ensure that the
DB2
Post by Steve Kass
Post by Ian Boyd
Multisystem product is installed on your system and create a nodegroup
with
Post by Ian Boyd
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL
error ]
Post by Steve Kass
Post by Ian Boyd
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL
error ]
Post by Steve Kass
Post by Ian Boyd
OLE DB error trace [OLE/DB Provider 'IBMDA400'
ICommandPrepare::Prepare
Post by Ian Boyd
Post by Steve Kass
Post by Ian Boyd
returned 0x80004005: ].
i can view the tables and views of the ODBC linked server, and get
things
Post by Steve Kass
Post by Ian Boyd
Name: CSPCM
Schema: CMS73DTA
Catalog: WC400B
If i try to view the tables and views of the OLEDB linked server,
Enterprise
Post by Ian Boyd
Manager locks up.
So i fiddling with my openquery notation and 4 part notation, using the
values above (CMS73DTA, WC400B)
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB
provider
Post by Ian Boyd
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from cms73dta.cspcm'].
select * from openquery(sass400, 'select * from wc400b.cspcm')
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDA400' reported an error.
[OLE/DB provider returned message: SQL0204: CSPCM in WC400B type *FILE
not
Post by Steve Kass
Post by Ian Boyd
found.
Cause . . . . . : CSPCM in WC400B type *FILE was not found. If this is
an
Post by Ian Boyd
ALTER TABLE statement and the type is *N, a constraint was not found. If
this is not an ALTER TABLE statement and the type is *N, a function,
procedure, or trigger was not found. Recovery . . . : Change the name
and
Post by Ian Boyd
try the request again. If the object is a node group, ensure that the
DB2
Post by Steve Kass
Post by Ian Boyd
Multisystem product is installed on your system and create a nodegroup
with
Post by Ian Boyd
the CRTNODGRP CL command.]
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL
error ]
Post by Steve Kass
Post by Ian Boyd
[OLE/DB provider returned message: CWBDB0036 - Server returned SQL
error ]
Post by Steve Kass
Post by Ian Boyd
OLE DB error trace [OLE/DB Provider 'IBMDA400'
ICommandPrepare::Prepare
Post by Ian Boyd
Post by Steve Kass
Post by Ian Boyd
returned 0x80004005: ].
select * from openquery(sass400, 'select * from
wc400b.cms73dta.cspcm')
Post by Steve Kass
Post by Ian Boyd
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from wc400b.cms73dta.cspcm'. The
OLE
Post by Ian Boyd
DB
Post by Steve Kass
Post by Ian Boyd
provider 'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from wc400b.cms73dta.cspcm'].
select * from openquery(sass400, 'select * from cms73dta.cspcm')
Server: Msg 7357, Level 16, State 2, Line 1
Could not process object 'select * from cms73dta.cspcm'. The OLE DB
provider
Post by Ian Boyd
'IBMDA400' indicates that the object has no columns.
OLE DB error trace [Non-interface error: OLE DB provider unable to
process
Post by Ian Boyd
object, since the object has no columnsProviderName='IBMDA400',
Query=select
Post by Ian Boyd
* from cms73dta.cspcm'].
select * from sass400.wc400b.cms73dta.cspcm
Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'IBMDA400'. A
four-part name was supplied, but the provider does not expose the
necessary
Post by Ian Boyd
interfaces to use a catalog and/or schema.
OLE DB error trace [Non-interface error].
select * from sass400..cms73dta.cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
select * from sass400...cspcm
Server: Msg 7351, Level 16, State 2, Line 1
OLE DB provider 'IBMDA400' could not map ordinals for one or more
columns
Post by Steve Kass
of
Post by Ian Boyd
object 'DBSCHEMA_TABLES'.
OLE DB error trace [OLE/DB Provider 'IBMDA400'
IColumnsInfo::MapColumnIDs
Post by Steve Kass
Post by Ian Boyd
returned 0x80040e21: [COLUMN_NAME=TABLE_CATALOG ORDINAL=-1],
[COLUMN_NAME=TABLE_SCHEMA ORDINAL=-1], [COLUMN_NAME=TABLE_NAME
ORDINAL=-1],
Post by Ian Boyd
[COLUMN_NAME=TABLE_TYPE ORDINAL=-1], [COLUMN_NAME=TABLE_GUID
ORDINAL=-1]].
Post by Steve Kass
Post by Ian Boyd
select * from ballycms...cspcm
[one row of data]
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC
Driver
Post by Steve Kass
Post by Ian Boyd
(32-bit)]Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows
returned
Post by Ian Boyd
0x80004005: ].
And yet, using ADO and the existing DSN, i can query and retrieve data
fine.
Post by Ian Boyd
Why can't SQL Server using ODBC work as well as ADO using ODBC?
i've been fighting with this for 3 months now - i just want data from an
ODBC source.
And then it hits you, you're so tired of IBM.
Ian Boyd
2004-08-22 11:36:23 UTC
Permalink
Post by Uri Dimant
Ian
We have installed the client access on the SQL Server and then by using DTS
we get the data from AS400.
I agree, that creates some problems.
i need data live at query time.
Uri Dimant
2004-08-22 12:42:49 UTC
Permalink
Ian
If you are able to write .NET app that connects to AS400 then you might get
a data at query time.
Post by Ian Boyd
Post by Uri Dimant
Ian
We have installed the client access on the SQL Server and then by using
DTS
Post by Uri Dimant
we get the data from AS400.
I agree, that creates some problems.
i need data live at query time.
Ian Boyd
2004-08-22 12:39:26 UTC
Permalink
Post by Uri Dimant
If you are able to write .NET app that connects to AS400 then you might get
a data at query time.
But i need need it as a linked server in SQL Server.

ADO can connect, through ODBC, to the data.

SQL can't.
Eric Glenn
2004-11-02 17:07:02 UTC
Permalink
My experience applies to DB2/400

Does
select count(*) from SASS400.WC400B.CMS73DTA.CSPCM
produce any results?

On the Security tab of the "Linked Server Properties", I had to establish a
local server login to remote server login. "For a login not defined in the
list", radio button "Be made without using a security context" is selected.

You may need to cast some datatypes. example: cast( your_date as varchar( 10
) )

We had a native RPG program that put spaces into a numeric field. DB2 didn't
discard the result set and / or issue OLE/DB provider returned messages.

If you intend to update the table, make sure that you enable journalling for
the table on the AS400.

Hope that this is helpful
Eric Bits
2004-11-02 17:09:01 UTC
Permalink
My experience applies to DB2/400

Does
select count(*) from SASS400.WC400B.CMS73DTA.CSPCM
produce any results?

On the Security tab of the "Linked Server Properties", I had to establish a
local server login to remote server login. "For a login not defined in the
list", radio button "Be made without using a security context" is selected.

You may need to cast some datatypes. example: cast( your_date as varchar( 10
) )

We had a native RPG program that put spaces into a numeric field. DB2 didn't
discard the result set and / or issue OLE/DB provider returned messages.

If you intend to update the table, make sure that you enable journalling for
the table on the AS400.

Hope that this is helpful
dhay1999
2004-11-08 17:41:38 UTC
Permalink
Create Linked Server
Provider = IBMDA400 (Client access)
Provider String your library list comma separated
Catalog - usually the AS400 netname, same as used in 4 part naming.

check all items under Provider Options

Set up remote login mapping

check all but collation compatible under server options

worked for me, and even allowed updates to non journaled files. too
me 3 months off and on to finally figure this out!

You can find out the net name from running
DSPNETA from the as400 command line.

David Ha


-
dhay199
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message979460.htm

Continue reading on narkive:
Loading...