Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating Connection string for DB2
#1
Solved: 10 Years, 9 Months, 1 Week ago
Hi,

I am trying to craete a cnnection string for DB2 but cannot it working. Here are the functions I am suing. Could someone please tell me what is wrong. I believe it is the data Source but dont know what that is.

Code:
Function getConnection ()
    On Error Resume Next
    Dim oConnection,ConnectionString
    ConnectionString ="jdbc:db2://ny-c-012:50000/hztest" '"Provider=Microsoft.Jet.OLEDB.4.0"
    Data Source="DB2LUW"'"hztest"'C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight32.mdb"
    User Id="db2admin", Password="Ibmtest1"
    Set oConnection = CreateObject("ADODB.Connection")
    oConnection.Open ConnectionString
    Set getConnection = oConnection
End Function

Function CheckConnection
   Dim MyConnString, MyConnection
   Set MyConnection = getConnection
   If MyConnection.Errors.Count = 0 Then
       Print "Database Connected"
    else
        Print "Database Failed"
   End If
End Function

Thanks,
Sqadri
Reply


Messages In This Thread
Creating Connection string for DB2 - by sqadri - 04-13-2012, 03:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Connection String for Oracle robertosalemi 6 11,726 01-15-2016, 04:51 PM
Last Post: robertosalemi
  DB2 Connect connection with IE 11 SRP 1 2,415 12-18-2015, 12:41 PM
Last Post: vinod123
  IBM DB2 connection with VB script bmurali 2 10,464 12-18-2015, 12:38 PM
Last Post: vinod123
  Connection with HP ALM hachem 0 2,414 02-26-2015, 04:36 PM
Last Post: hachem
  “Cannot connect to 8822 (connection timed out)" Ikbal 0 1,997 12-08-2014, 11:38 PM
Last Post: Ikbal

Forum Jump:


Users browsing this thread: 1 Guest(s)