Connect to AS400 default collection

285 views
Skip to first unread message

Rechie Sanchez

unread,
Mar 11, 2015, 5:24:29 AM3/11/15
to ibm...@googlegroups.com
I am able to connect to our data using Default Collection with the dsn connection string.

"Provider=IBMDA400;Data Source=10.33.XX.X;User Id=user;Password=pass;Default Collection=mm370lib;"
But how can I connect using ibm_db? What I've tried was:

import ibm_db, ibm_db_dbi
ibm_db_conn
= ibm_db.connect("DATABASE=mm370lib;HOSTNAME=10.33.XX.X;PROTOCOL=TCPIP;UID=user;PWD=pass;", '', '')


with an error:

Exception: [IBM][CLI Driver] SQL30061N  The database alias or database name "MM370LIB          " was not found at the remote node.  SQLSTATE=08004 SQLCODE=-30061

What did I miss? How can I determine the database/default collection?

Rahul

unread,
Mar 11, 2015, 5:46:50 AM3/11/15
to ibm...@googlegroups.com
In connection string you have missed PORT number, please pass port number also and let us know in case of any issue.

Thanks,
Rahul

Richard la Croix

unread,
Mar 11, 2015, 12:15:06 PM3/11/15
to ibm...@googlegroups.com
In DB2 on i "collection" means "schema" means "library". "mm370lib" suggests it is actually the library name.

The DATABASE name to use in the connect string is usually the name of your system, but to be sure, check with DSPRDBDIRE. It is the entry with *LOCAL.

I haven't found out how to specify the default schema/library in the connect string (if it is possible at all).

Regards,
Richard

Gwith

unread,
Jan 22, 2018, 1:19:26 AM1/22/18
to ibm_db
How do you know what port to connect on?

Saba Kauser

unread,
Jan 22, 2018, 1:20:57 AM1/22/18
to ibm...@googlegroups.com
This is the port you have chosen while installing the server.

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm_db+unsubscribe@googlegroups.com.
To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
For more options, visit https://groups.google.com/d/optout.

kad...@us.ibm.com

unread,
Jan 22, 2018, 2:46:14 PM1/22/18
to ibm_db
Reply all
Reply to author
Forward
0 new messages