1.11M Members

Connecting to DB2 databse

 
0
 

I am trying to connect to db2, but there is an error "system.data.oledb.oledbexception unspecified error"
and highlighted the line conn.Open() .
I want to know what are the prerequisites for the connection. Or simply my code is doing wrong???
Thank you for any help.

Dim Source As String
  Source = "Provider=IBMDADB2.DB2COPY1;Database=mydb;PROTOCOL=TCPIP;PORT=portnum;Hostname:host;"
  Source = Source & "uid=myid;Password=mypsw;"
  Dim conn As OleDbConnection                             
  conn = New OleDbConnection(Source)   
  conn.Open()
  .
  .
  .
  conn.Close()
You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article