Hi Lorenz, you posted your question in the Db2 z/OS forum which is actually a different flavor of Db2 running on the mainframe platform. But anyway, perhaps we can figure this out here. Just for my understanding:
You installed the Db2 11.5.8 Community Edition on your Windows PC and assigned user "admin" to the Db2 services, right? Does "admin" have administrator permissions on your Windows PC?
Your ODBC application is supposed to run on your Windows PC and should connect to the local Db2 instance. Did you create a database named "BLUDB" on your Db2 server? Can you open a Db2 Command Window (Windows button, then "IBM DB2 DB2COPY1 (Default)", then "DB2 Command Window") and enter:
db2 list db directory
This should show all available databases. If BLUDB is listed, then open MS ODBC Administrator (run "odbcad32" from command window) and check whether BLUDB is registered as either a System or User DSN. If it is listed, run a connection test from the ODBC Administrator window and see whether that works.
If it is not listed, then run
db2 catalog system odbc data source BLUDB
if you are running the Db2 Command Window with local administrator privileges. If you did not open the Db2 Command Window with administrator privileges, replace "system" with "user". Then open MS ODBC Administrator again and check that BLUDB is listed here (it is supposed to be). Retry the connection test. Before you start working with your R application we need to make sure that the basic Db2 and ODBC setup is correct.
------------------------------
Christoph Theisen
Rocket Software
------------------------------
Original Message:
Sent: Mon November 07, 2022 09:35 AM
From: Lorenz Wagner
Subject: Problems installing and using DB2
Hi guys, I have the following problem. I am trying to get the r-package 'ibmdbR' to work. Since I am brand new to the whole IBM matter, please forgive me beginner mistakes.
First I downloaded the Db2 Community Edition () and installed it on my Windows PC. Here I did the following things in the installation client:
Installed the 'Db2 Version 11.5.8.0 Server Edition'. I used the default installation type, installed DB2 locally, used 'admin' for username and password and created a local contact list.
Then I created an ODBC connection according to this page (https://www.ibm.com/docs/en/iad/7.2.1?topic=s2iccwpa-configuring-odbc-data-source-db2-data-warehouse-1) and named it 'BLUDB'. I didn't add anything to the alias and clicked ok).
Then I went into R, loaded the package and ran the following command.
con <- con <- idaConnect('BLUDB','admin','admin').
But when I do this, I always get this error:
Warning messages:
1: In RODBC::odbcDriverConnect("DSN=BLUDB;UID=admin;PWD=admin", believeNRows = FALSE) :
[RODBC] ERROR: Status IM004, Code 0, Message [Microsoft][ODBC Driver Manager] Error in SQLAllocHandle call for driver on SQL_HANDLE_ENV
2: In RODBC::odbcDriverConnect("DSN=BLUDB;UID=admin;PWD=admin", believeNRows = FALSE) :
ODBC connection failed
What did I do wrong and how do I get it to work? I need to get this to work for university unfortunately.
You can find the guide here:
https://cran.r-project.org/web/packages/ibmdbR/vignettes/ibmdbR.pdf
------------------------------
Lorenz Wagner
------------------------------
#Db2forz/OS