Title: Using ASP to read DB2 on AS400

Hi all,

Sorry about the earlier post. Trying again.

I am trying to read from a table on the AS400 using ASP and I get the following error:

ADODB.Fields error '800a0cc1'
ADO could not find the object in the collection corresponding to the name or
ordinal reference requested by the application.


The error point to the following line:
<td><%=rs("ACOMP")%></td>

Here is a part of my code:

Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Provider=IBMDA400; Data Source=AS400;", "abc", "xyz"
Set cm = Server.CreateObject("ADODB.Command")
Set cm.ActiveConnection = cn
cm.Properties("Updatability") = 0
cm.CommandText = "/QSYS.LIB/SPIL.LIB/PBDAGENT.FILE(*FIRST, *NONE)"
cm.CommandType = adCmdTable
Set rs = cm.Execute

with rs
Do While Not .Eof
%> 
    <tr>
        <td><%=rs("ACOMP")%></td>
        <td><%=rs("AGEN")%></td>
    </tr>
<%
  .MoveNext
Loop
end with

rs.Close
cn.Close



I understand that this error comes when the field is not found. I already verified that the field names are correct. When I access the fields array with a subscript, it works fine. But I want to be able to use field names instead of array subscripts.

I would appreciate it if someone could tell me what I am doing wrong.

Thanks in advance.


Sushama


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.