I have to connect Testcomplete project with Db2/AS400 database using JDBC request. It requires a driver so I copied the jt400 jar in the 'bin' folder of TestComplete. I'm using the following to establish the connection between the TestComplete project and DB2/AS400:
var conn = ADO.CreateADOConnection(); conn.ConnectionString = "Driver =jt400.jar;"+ "Data Source =ussys;" + "CurrentSchema=USER;" + "User ID=XXXXXXX;" + "Password=XXXXXXX;"
conn.LoginPrompt = false;
I see a runtime error: OLE 80040E4D
I think it's related to the Connection string, but I'm not able to find out what's wrong.
Could someone please help me understand what's missing in the connection string or anything else?
Solved! Go to Solution.
JDBC and .jar files is Java-related stuff. You need to find regular Windows 32-bit ODBC drivers (or OLE providers) (because TestComplete is 32-bit application) for DB2/AS400 and install them. Whether or not will these drivers require Java depends on their implementation and I hope that their respective installers will take care about this.
Than you will have to create DSN, referencing the database that you are going to use, using ODBC Administrator and use this DSN when specifying connection for .CreateADOConnection(). This is in case ODBC drivers are used. In case of OLE providers, no DSN is required and connection string must be provided for .CreateADOConnection().
P.S. This thread (https://community.smartbear.com/t5/TestComplete-Functional-Web/Can-anyone-help-me-how-to-access-Mong...) may help you with creation of connection string.
Thank you, Alex! This helped me.
Windows 64-bit machines come with 32-bit and 64-bit odbc drivers so I didn't have to install a new one.
But for AS400 I'm using IBMDA400 driver which made the connection work.
appreciate your help!
I didn't find IBMDA400 driver in my system with windows 64bit. Did you install it seperately or did you get it through OS directly?
If installed, what is the exact driver name you installed?
Kindly let me know
This is a separate third-party driver that must be installed manually.
Thanks for the response. I've installed IBM DB2 driver from the below link provided. I created a new DSN with the IBM DB2 driver selected and tried to connect. I am facing an issue after clicking on connect. What is the data source name we should mention while creating the DSN?
Please refer the screenshot of the issue and suggest.
Important note 1:
TestComplete and ODBC driver must be of the same bitness. 64-bit flavor of TestComplete is located in the <TestComplete.\x64\bin\ folder, while 32-bit flavor is in the <TestComplete>\bin one. Pay attention to this or TestComplete (and ADO subsystem) will not be able to find your DSN and driver.
Important note 2:
You must use the odbcad32.exe utility to create and configure DSN for the ODBC driver. Like TestComplete, the bitness of odbcad32 must match the bitness of the ODBC driver. odbcad32 must be started from the <Windows>\System32\ folder if you are working with 64-bit ODBC driver. If you are working with 32-bit ODBC driver, then start odbcad32 utility from the <Windows>\SysWOW64\ folder.
Further refers the screenshot you've posted:
Use these steps to create a DSN:
-- start odbcad32 utility;
-- Switch to the User DSN tab if you like to create a DSN that is accessible to your account only. Switch to the System DSN tab if you like to create a DSN that is accessible to any user logged into the given computer. Note, that in the latter case odbcad32 must be started with the elevated privileges (Run As Administrator);
-- Click the Add... button, provide whatever name for the DSN and select the appropriate ODBC driver (DB2/AS400 in your case);
-- Select created DSN in the list, click the Configure... button and provide parameters required by the driver;
-- Click Test button to test the connection. Test must succeed.
Succeeded connection test means that the DSN exists and is properly configured.
Now you must craft the OLE DB connection string that you will provide to the ADO subsystem which is used by TestComplete to access databases. https://www.connectionstrings.com/as-400/ provides examples of AS400 connection strings.
https://community.smartbear.com/t5/TestComplete-Functional-Web/Can-anyone-help-me-how-to-access-Mong... may be used as a possible way to create and verify ADO connection string.
Note: If you installed OLE DB provider instead of ODBC driver, there is no need to create and configure DSN then. Only OLE DB connection string must be created in this case.
Please refer the following steps which I followed:
1. Downloaded and installed v9.5fp10_ntx64_odbc_cli driver
2. Testcomplete which I use is 64bit, so to create a DSN, I've navigated to
3. Started odbcad32 utility with the elevated privileges (Run As Administrator);
4. Opened System DSN --> Add -->Selected IBM Data Server Driver
5. Entered Datasourcename as 'GIASDTADEV' --> Add--> given the username and password
6. After creating the DSN, clicked on configure and connect.
7. I am seeing the error attached in the screenshot1
8. So, I've edited the confg file manually. Attached even this file for reference.
9. I am not knowing what went wrong that is producing this error. Kindly , provide me a soultion