View Full Version : Connecting to DB2... Please help!!
nitric
07-28-2003, 10:46 AM
Hi All
Please help me connect to a DB2 database using ASP. I don't even know where to start and seem to be going in circles when I try to use the web .
I'd appreciate any help with connection strings, ole db drivers, etc...
Thanks!!!:confused:
glenngv
07-28-2003, 10:56 AM
Did you search the net (http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=connection+string+in+ASP) first?
nitric
07-28-2003, 12:01 PM
Extensively. I seem to be making progress though... I've created a system DNS linked to the db2 database I am using.
Is this method advisable for a production environment?
best bookmark this page
http://www.able-consulting.com/ADO_Conn.htm
has a link to the OLE DB provider for DB2. (+ manny manny other connectionstrings)
Using a DSN (I suppose you meant a DSN ...) is more a less OK if the DB runs on your own machine. If you need to run it on a host, DSN connections aren'tthe best way to go, since only your host can create them --> most of them don't do this for free
+ using a DSN means that for each query, the webserver needs to look the db-details up in your ODBC, and like all process, this takes up a bit of the server-resources and creates a tiny delay + it's an extra risk. If there's heavy trafic on your site (why else should you use DB2 ?) then this will becomme noticable. (kinda like driving a sportscar without a stick --> not advicable)
nitric
07-28-2003, 01:40 PM
Well I've looked at that page before. I don't really understand the syntax in the connection string. When I look at the MSDN site, references are made to Host Integration Server.
Do I need Host Integration Server to talk to a remote DB2 database? Im running Windows Server 2003 enterprise... Won't this have everything I need in it?
nitric
07-28-2003, 03:32 PM
One more question: When I specify the provider as DB2OLEDB, it says the provider is not installed? Am I correct in understanding that I should either install HIS 2000 or DB Connect to rectify this?
fractalvibes
07-28-2003, 05:25 PM
This is a good starting place:
http://www7b.boulder.ibm.com/dmdd/
What type of remote system is the DB2 DBMS running on? You may need DB2Connect for this.
Your connection string should be something like:
ConnectString = "Provider=IBMDADB2;DSN=" & MDatabaseName & ";UID=" & MyUserId & ";PWD=" & MyPassword & ";"
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.