By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

IBM.Data.DB2.iSeries database access problem

P: n/a
When I run the following vb.net code, I'm not able to acces the my database
AMFLIB.

I use to be able to access AMFLIB with the old ODBC driver from IBM iSeries
Access but now I want to use the new managed IBM.Data.DB2.iSeries data
provider from iSeries Access V5R3.

When I remove Database=AMFLIB from the connection string, I can connect but
as soon as I try to specify a known database (like my good old AMFLIB) I get
the following error:

IBM.Data.DB2.iSeries.iDB2ConnectionFailedException
"The connection cannot be opened because an error ocurred."

I'm running IBM iSeries Access V5R3 and my server is V5R2.

When I don't specify a database, after the connection is open the database
property is set to AS400REM. I don't know if this database is a real
database specific to my company.

******************************************
Imports IBM.Data.DB2.iSeries

Dim cn As New iDB2Connection

Try
TestConnection.ConnectionString = _
"DataSource=AS400;UserID=xxxx;Password=xxxx;Databa se=AMFLIB"

TestConnection.Open()
If TestConnection.State = ConnectionState.Open Then
MsgBox("Database: " & TestConnection.Database)
TestConnection.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
******************************************

Thanks to all
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Yanik Reid wrote:
When I run the following vb.net code, I'm not able to acces the my database
AMFLIB.

I use to be able to access AMFLIB with the old ODBC driver from IBM iSeries
Access but now I want to use the new managed IBM.Data.DB2.iSeries data
provider from iSeries Access V5R3.

When I remove Database=AMFLIB from the connection string, I can connect but
as soon as I try to specify a known database (like my good old AMFLIB) I get
the following error:

IBM.Data.DB2.iSeries.iDB2ConnectionFailedException
"The connection cannot be opened because an error ocurred."

I'm running IBM iSeries Access V5R3 and my server is V5R2.

When I don't specify a database, after the connection is open the database
property is set to AS400REM. I don't know if this database is a real
database specific to my company.

******************************************
Imports IBM.Data.DB2.iSeries

Dim cn As New iDB2Connection

Try
TestConnection.ConnectionString = _
"DataSource=AS400;UserID=xxxx;Password=xxxx;Databa se=AMFLIB"

TestConnection.Open()
If TestConnection.State = ConnectionState.Open Then
MsgBox("Database: " & TestConnection.Database)
TestConnection.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
******************************************

Thanks to all


You may want to review the online ODBC connection string info here:
http://publib.boulder.ibm.com/infoce...ik/rzaik15.htm

It appears that DATABASE refers to the RDB name, not a specific library
(schema/collection). You can determine the local RDB name by using the
WRKRDBDIRE command on an iSeries command line - see the entry designated
*LOCAL. You should also see the local RDB name using iSeries Navigator,
under the Databases tab in the left pane, when connected to the desired
iSeries system.

--

Karl Hanson
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.