I am trying to connect to an IBM AS/400. Can anyone help me interpet the error and possible guid me what to do. Thanks

Code:

Dim myAS400Connection As New OleDb.OleDbConnection

myAS400Connection.ConnectionString = ("Provider=SNAOLEDB;" & _
"Data source=as820;" & _
"User Id=vbuser;" & _
"Password=vbuser")

myAS400Connection.Open()

Error:

Exception Details: System.Data.OleDb.OleDbException: No error information available: REGDB_E_CLASSNOTREG(0x80040154).

Line 46: myAS400Connection.Open()

[InvalidOperationException: The 'SNAOLEDB' provider is not registered on the local machine.]

Recommended Answers

All 5 Replies

Are you sure you are using the proper OLE DB Provider?

Consider:
OLE DB Provider for AS/400 and VSAM (from Microsoft)

oConn.Open "Provider=SNAOLEDB;" & _
           "Data source=myAS400;" & _
           "User Id=myUsername;" & _
           "Password=myPassword"

For more information, see: ConnectionString Property

To view Microsoft KB articles related to OLE DB Provider for AS/400 and VSAM

Or
OLE DB Provider for AS/400 (from IBM)

oConn.Open "Provider=IBMDA400;" & _
           "Data source=myAS400;" & _
           "User Id=myUsername;" & _
           "Password=myPassword"

For more information, search: A Fast Path to AS/400 Client/Server

I tried using the IBMDA400 provider (instead of SNAOLEDB). Now it gives me another error. Is there a config seeting I am missing ... or ??


Code:

Imports System.Data.OleDb
Dim myAS400Connection As New OleDb.OleDbConnection
Dim myAS400Command As New OleDb.OleDbCommand

myAS400Connection.ConnectionString = "Provider=IBMDA400; Data source=AS820; User Id=vbuser; Password=vbuser"

myAS400Connection.Open()

Error:

Non-NULL controlling IUnknown was specified, and either the requested interface was not IUnknown, or the provider does not support COM aggregation.

Exception Details: System.Data.OleDb.OleDbException: Non-NULL controlling IUnknown was specified, and either the requested interface was not IUnknown, or the provider does not support COM aggregation.

Line 63: myAS400Connection.Open()

Hmm not sure of what to say. I have searched the web for an answer, but just the same response for that error.... no solution found.

Try google yourself, maybe you will have better luck than me.

Have you verified that th SNAOLEDB provider is installed on your MAchine where this code is running :

You may want to go to registry and check it . OR simply hit test connect on UDL , if this gives a message that " provider is not " available try installing the Product again ( making sure that Data Integratiuon feature is selected on install). Or you may try add / remove programs to install only this feature.


Asmita
http://blogs.msdn.com/asmitaw/


I am trying to connect to an IBM AS/400. Can
anyone help me interpet the error and possible guid me what to do. Thanks

Code:

Dim myAS400Connection As New OleDb.OleDbConnection

myAS400Connection.ConnectionString = ("Provider=SNAOLEDB;" & _
"Data source=as820;" & _
"User Id=vbuser;" & _
"Password=vbuser")

myAS400Connection.Open()

Error:

Exception Details: System.Data.OleDb.OleDbException: No error information available: REGDB_E_CLASSNOTREG(0x80040154).

Line 46: myAS400Connection.Open()

[InvalidOperationException: The 'SNAOLEDB' provider is not registered on the local machine.]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.