ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Connect to AS400 from VB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connect to AS400 from VB

    I am trying to connect from VB to AS/400. I get an exception error. Here is the code:

    Dim myAS400Connection As New OleDb.OleDbConnection
    Dim MyUser As String = "vbuser"
    Dim MyPassword As String = "vbuser"

    myAS400Connection.ConnectionString = "Provider=IBMDA400; Data source=DFBFL; User Id=MyUser; Password=MyPassword"

    myAS400Connection.Open()


    Error I get is: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    I am using the cwbx reference.

  • #2
    Re: Connect to AS400 from VB

    Originally posted by snufse
    I am trying to connect from VB to AS/400. I get an exception error. Here is the code:

    Dim myAS400Connection As New OleDb.OleDbConnection
    Dim MyUser As String = "vbuser"
    Dim MyPassword As String = "vbuser"

    myAS400Connection.ConnectionString = "Provider=IBMDA400; Data source=DFBFL; User Id=MyUser; Password=MyPassword"

    myAS400Connection.Open()


    Error I get is: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    I am using the cwbx reference.
    How does your PC know what "DFBFL" is? Is there an entry in a DNS, or your LMHOSTS file, or what?
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment

    Working...
    X