f



IBM.Data.DB2.iSeries database access problem

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;Database=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 


0
Yanik
2/13/2005 4:24:17 PM
comp.databases.ibm-db2 12448 articles. 3 followers. arunrocks (9) is leader. Post Follow

1 Replies
665 Views

Similar Articles

[PageSpeed] 0

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;Database=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/infocenter/iseries/v5r3/ic2924/index.htm?info/rzaik/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
0
Karl
2/13/2005 9:33:16 PM
Reply: