Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003

    Unhappy Unanswered: Connecting to DB2 with ASP/VBScript

    Can someone show me how to connect to a DB2 database using ASP and VBScript? I have tried various things, but none have worked out.

    We do *not* have MS Host Integration Server and cannot afford the $2000 for it. We do have the DB2 Runtime Client 7.2.10 installed and the DB2 DSN is properly configured. The connection test works out fine.


  2. #2
    Join Date
    Jan 2003
    You will need a driver for the connection and this is where it gets more

    complicated. What version of DB2 are you connecting to? Is it running on

    AIX? NT? OS390? AS400? Basically, you'll need to find the ODBC and/or

    OLE DB (if it's available for the version of DB2 you're running) drivers for

    the version and platform of DB2 you are running. Two good places to start

    are IBM's Web site (specifically the sections about DB2) and the Micrsoft

    Web site (specifically the section about data access at

    Depending on your version of DB and the platform it's on, you may need or

    want to use a third-party vendor's drivers. We currently use Neon Systems'

    ShadowDirect to create an ODBC connection to DB2 running on an OS/390

    OLE DB Provider for DB2 (from Microsoft) 
    For TCP/IP connections
    oConn.Open = "Provider=DB2OLEDB;" & _
                 "Network Transport Library=TCPIP;" &  _
                 "Network;" & _
                 "Initial Catalog=MyCatalog;" & _
                 "Package Collection=MyPackageCollection;" & _
                 "Default Schema=MySchema;" & _
                 "User ID=MyUsername;" & _
    For APPC connections
    oConn.Open = "Provider=DB2OLEDB;" &  _
                 "APPC Local LU Alias=MyLocalLUAlias;" &  _
                 "APPC Remote LU Alias=MyRemoteLUAlias;" &  _
                 "Initial Catalog=MyCatalog;" & _
                 "Package Collection=MyPackageCollection;" & _
                 "Default Schema=MySchema;" & _
                 "User ID=MyUsername;" & _

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts