ASP and AS/400

Discussion in 'ASP General' started by Jack, Nov 29, 2003.

  1. Jack

    Jack Guest

    Hi,

    Using VbScript in an ASP page, I want to access a database stored on the
    AS/400. Should I use ADO, ODBC or anyother way of doing it?

    And is it possible to have some sample codes?

    Thanks

    Jack
     
    Jack, Nov 29, 2003
    #1
    1. Advertising

  2. Jack

    Ray at Guest

    Treat it just like any other data source. If you have OLEDB drivers for
    DB2, use them. If you only have ODBC, use them. IBM's Client Access [even
    Express] comes with both, and you can choose to just install the drivers on
    your IIS server without installing the full CA application. One of the only
    things I know to watch out for is to never end your queries with a ;. And
    just think LIBRARY=database, FILE=table. Here is sample code using IBM's
    OLEDB drivers:




    Function ReturnCIFArray(BankNumber, JulianDate)


    sDB2String = "Provider=IBMDA400.DataSource.1;Persist Security
    Info=False;User ID=AnAS400UserID;Password=ValidPassword;Data
    Source=HOST_NAME_OR_AS_400_IP_ADDRESS;Catalog Library
    List=LIBRARY1,LIBRARY2,LIBRARY3"

    sDB2SQL = sDB2SQL & "SELECT LIBRARY1.FILE1.MEMBER1 FROM LIBRARY1.FILE1
    WHERE LIBRARY1.FILE1.MEMBER2='some value'"

    Set oDB2ADO = Server.CreateObject("ADODB.Connection")
    oDB2ADO.Open sDB2String

    Set SomeRecordset = oDB2ADO.Execute(sDB2SQL)
    If Not SomeRecordSet.EOF Then TheResults = SomeRecordSet.GetRows()
    SomeRecordSet.Close : Set SomeRecordSet = Nothing
    oDB2ADO.Close
    Set oDB2ADO = Nothing

    Fully qualifying the files isn't necessary if you're only looking in one
    library, but for illustration purposes, I qualified them and included a
    library list in the connection string.

    Ray at work


    "Jack" <> wrote in message
    news:lqRxb.359$...
    > Hi,
    >
    > Using VbScript in an ASP page, I want to access a database stored on the
    > AS/400. Should I use ADO, ODBC or anyother way of doing it?
    >
    > And is it possible to have some sample codes?
    >
    > Thanks
    >
    > Jack
    >
    >
     
    Ray at, Nov 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan C Douglas
    Replies:
    5
    Views:
    418
    Dan C Douglas
    Jul 22, 2003
  2. Amaryllis
    Replies:
    2
    Views:
    2,394
    Amaryllis
    Aug 3, 2004
  3. Luqman
    Replies:
    3
    Views:
    1,812
    S. Justin Gengo
    Sep 28, 2005
  4. Scott McNair

    400 session thru ASP.NET?

    Scott McNair, Aug 3, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    Scott McNair
    Aug 3, 2005
  5. JAC

    Error 400 asp page

    JAC, Apr 7, 2005, in forum: ASP General
    Replies:
    1
    Views:
    181
    Erik Adas
    Apr 8, 2005
Loading...

Share This Page