× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Using ASP to read DB2 on AS400
  • From: "John Taylor" <jtaylor@xxxxxxxxxxxx>
  • Date: Tue, 24 Jul 2001 08:12:58 -0600

Using ASP to read DB2 on AS400Hi Sushama,

Two things immediately spring to mind:

1) There is a known issue (I opened the APAR but don't have the number
handy) on V4R4 where the column names were not being returned by the OLE
driver. It was resolved by an database PTF.

2) I don't have any experience doing ASP, so this might be completely off
the mark, but it seems odd to me that you'd reference your field with a
qualifier from within a "With" block. ie:

Instead of:

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


What if you were to try:

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


John Taylor

----- Original Message -----
From: Pillai, Sushama
To: WEB400@midrange.com
Sent: Tuesday, July 24, 2001 07:21
Subject: 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

+---
| This is the WEB400 Mailing List!
| To submit a new message, send your mail to WEB400@midrange.com.
| To subscribe to this list send email to WEB400-SUB@midrange.com.
| To unsubscribe from this list send email to WEB400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.