I did not find any instruction for this one so im sharing my solution with you guys.
To properly configure the Oracle Database Connection:
1) Install the driver available in (b)
2) Perform 'Data Source' configuration available in point c).
3) Learn how to handle ADO class in TestComplete
Example of a valid JS to connect TC to Oracle:
var connectstring = "Data Source=Oracle Wire Protocol;User ID=user;Password=pass"; var query = ADO.CreateADOQuery(); query.ConnectionString = connectstring; query.SQL = "select * from MRP_PERFORMANCE;"; query.Open(); query.First(); var res = query.FieldByName("Field").Value;
var connectstring = "Data Source=Oracle Wire Protocol;User ID=user;Password=pass"; var query = ADO.CreateADOQuery(); query.ConnectionString = connectstring; query.SQL = ` SELECT mrp.firm_mrp(1) AAAAA FROM firm `; query.Open(); query.First(); var res = query.FieldByName("AAAA").Value;
(a) Doc SmartBear:
In the article there is an entry (7) giving a valid example of a connection to the Oracle database using ADO class
(b) Oracle ODBC Driver
Using this driver allows you to set the appropriate 'Data Source' in the connection string.
(c) Correct 'Data Source' configuration
Search for 'ODBC Administrator' service in Windows10 -> follow the instructions.
Correct in case you are using Oracle ODBC driver.
If you have Oracle OLE DB provider you may use pure ADO and provide relevant connection string.
I did not go through the referenced links, but one must remember that the bitness of ODBC driver, DSN (and ODBC Administrator) and/or OLE DB provider *must* match the bitness of TestComplete.
Thanks for sharing your investigation with us @Wamboo.
I'll add this topic to the TechCorner area.