If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Connecting to DB2 with ASP/VBScript

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-03, 10:24
Tikizan Tikizan is offline
Registered User
 
Join Date: Aug 2003
Posts: 3
Unhappy 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.

Tiki
Reply With Quote
  #2 (permalink)  
Old 08-11-03, 03:07
Memnoch1207 Memnoch1207 is offline
Registered User
 
Join Date: Jan 2003
Location: Midwest
Posts: 138
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

http://www.microsoft.com/data/).



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

mainframe.
Code:
OLE DB Provider for DB2 (from Microsoft) 
For TCP/IP connections

oConn.Open = "Provider=DB2OLEDB;" & _
             "Network Transport Library=TCPIP;" &  _
             "Network Address=xxx.xxx.xxx.xxx;" & _
             "Initial Catalog=MyCatalog;" & _
             "Package Collection=MyPackageCollection;" & _
             "Default Schema=MySchema;" & _
             "User ID=MyUsername;" & _
             "Password=MyPassword"

 
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;" & _
             "Password=MyPassword"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On