Multiple-step OLE DB operation generated errors...

J

John Leach

I am getting the following error message:

Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.

Below I will outline the scenario that generated, and would appreciate
help with this problem, but I have another question as well:

I have seen a great number of articles on google and in the .net help
regarding this error message and specific instances of how to make it
go away, but can someone tell me if you can get the actual individual
db error messages when this exception is thrown? I haven't seen
anything that talks about that. Is it possible?



Problem:
I am trying to connect to db2 on an AS/400 using the following code
executing with the parameter strProvider = "IBMDA400". I have been
adding parameters such as Transport Product and Persist Security Info
as I find little bits of info, with no luck.

*****************************************************************************

Private Function OleDBInit(ByVal strProvider As String) As Boolean
RaiseEvent Begin(templateObj.Exports.Count + 2)
RaiseEvent StepNext()

'Initialize and open the database connection
RaiseEvent StatusUpdate("Creating OLEDB object...")
RaiseEvent StepNext()
conOleDB = New OleDb.OleDbConnection

Select Case strProvider
Case "OraOLEDB.Oracle"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Data Source=" & strServerName &
";Provider=" & strProvider
Case "SQLOLEDB"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Initial Catalog=" & strDatabaseName &
";Data Source=" & strServerName & ";Provider=" & strProvider
Case "IBMDA400"
conOleDB.ConnectionString = "User ID=" & strUserName &
";Password=" & strPassword & ";Initial Catalog=" & strDatabaseName &
";Data Source=" & strServerName & ";Provider=IBMDA400.Datasource.1" &
";Persist Security Info=True" & ";Transport Product=Client Access" &
";SSL=DEFAULT"
Case Else
OleDBInit = False
Exit Function
End Select

Try
RaiseEvent StatusUpdate("Opening OLEDB connection...")
RaiseEvent StepNext()
***************************
conOleDB.Open()
***************************
Catch eOleDB As Exception
RaiseEvent ErrorOccured(eOleDB.Source & " - " &
eOleDB.Message)
OleDBInit = False
Exit Function
End Try

RaiseEvent StatusUpdate("Connected to database.")
RaiseEvent StepNext()

OleDBInit = True

End Function

*****************************************************************************

The exception is thrown when the conOleDB.Open() statement is
executed.

Thanks,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top