ADO and stored procedures

ADO and stored procedures

Post by Pascal Jeanblan » Wed, 09 Jan 2002 23:54:51



Hi,

I'm accessing to Informix 7.31 through ADO (OLE DB for ODBC drivers) and
Delphi 6. ADO seems to be puzzled by Informix stored procedures
returning columns without name.
I can access to data in a dataset by using COLUMN1, COLUMN2... as column
names but when I try to use them to sort or filter it, it fails with the
following message:

'Item cannot be found in the collection corresponding to the requested
name or ordinal'.

I tried different things, like using brackets, but no way...
Any idea?

Thanks in advance,

Pascal

 
 
 

ADO and stored procedures

Post by Paul McLaughli » Sat, 12 Jan 2002 01:37:15


Hi,
  You can't get the *name* of the return variables from a stored procedure
so you have to make do
  with localvar=rsData.fields(0)  for the first returned param and
rsData.fields(1) for the second etc..

HTH

Paul McLaughlin


Quote:> Hi,

> I'm accessing to Informix 7.31 through ADO (OLE DB for ODBC drivers) and
> Delphi 6. ADO seems to be puzzled by Informix stored procedures
> returning columns without name.
> I can access to data in a dataset by using COLUMN1, COLUMN2... as column
> names but when I try to use them to sort or filter it, it fails with the
> following message:

> 'Item cannot be found in the collection corresponding to the requested
> name or ordinal'.

> I tried different things, like using brackets, but no way...
> Any idea?

> Thanks in advance,

> Pascal


 
 
 

ADO and stored procedures

Post by Pascal Jeanblan » Sun, 13 Jan 2002 00:56:00



> Hi,
>   You can't get the *name* of the return variables from a stored procedure
> so you have to make do
>   with localvar=rsData.fields(0)  for the first returned param and
> rsData.fields(1) for the second etc..

> HTH

> Paul McLaughlin


> (...)
> > I can access to data in a dataset by using COLUMN1, COLUMN2... as column
> > names but when I try to use them to sort or filter it, it fails with the
> > following message:

> > 'Item cannot be found in the collection corresponding to the requested
> > name or ordinal'.

Paul,

thank you for your help.
The only workaround I've found so far is to insert rows into a temporary
table and not to drop it when the procedure returns and finally to base
my query on the table. I don't like this solution too much but I'm
afraid I've got no choice since I don't think I can write a sort or
filter clause without naming the fields.

Pascal

 
 
 

1. ADO with Stored Procedures

I am converting a VB5 app that uses RDO to talk to SQL 6.5 into VB6 and ADO
All works fine with the ADO provider set to SQL Server (i.e. using ODBC)
switch to a provider of SQLOLEDB
all still works apart from accessing stored procedures that have temp tables
within them (even very simple ones).

I cannot quite recall the error something like 'the operation requested by
the application cannot be compeleted because the object is closed' error
number 3704??

If i step thru the code the sproc executes okay but when I refer to the
result set I get the error e.g. 'if rs.eof = false'

I have tried different cursor libs etc with no joy, also upgraded to MDAC
2.1.

TIA

Peter Pringle

2. Oracle Question!

3. ADO/SQL70 Stored Procedure permission problems

4. create "microsoft.public.vc.database.rdo"

5. ADO, SQL, Stored Procedures & and Recordcount Property

6. informix support

7. Help urgent regard on ADO using stored procedures..

8. Delphi 2.0 and Microsoft SQL 6.5 maillingllist

9. paged recordsets with ADO and Stored Procedure

10. ASP,ADO,Dynamic Stored Procedure

11. ADO and stored procedure resultsets

12. How to use image with ADO and stored procedures

13. ADO and Stored Procedures