Forum Discussion
Have you installed the ODBC Driver from https://www.mongodb.com/try/download/odbc-driver ?
I'm not sure what the connection string should be.
Also, it's probably worth reading MongoDB to see if it is possible to drop the database via externally.
- Semirxbih3 years agoContributor
Almost seems like it's not possible, since I couldn't find much information online, I asked ChatGPT with a response "As it stands, it's unlikely that you'll be able to drop a MongoDB database directly from a TestComplete script using ADO and JScript.".
I've looked around and "mongodb://" connection string was not supported for ADOConnection.- AlexKaras3 years ago
Champion Level 1
Hi,
> I asked ChatGPT [...]
It lies pretty often...
and
might help.
In a nutshell:
-- ADO does not access data itself. ADO is a higher level interface that uses either native ADO driver or ODBC data source name (DSN) connection to access data;
-- It seem that native ADO driver for MongoDB does not exist. ODBC access is your only option if the above is correct;
-- In order to use ODBC, you need to: a) (find and) install MongoDB ODBC driver of some bitness (32- or 64-bit); b) create ODBC DSN connection using odbcad32 tool, tool must be started from either <windows>\system32\ (for 64-bit) or <windows>\SysWOW64\ folder (for 32-bit) depending on the bitness of installed MongoDB ODBC driver; c) set up ODBC DSN connection so that it can access data;
-- Craft ADO connection string using ODBC provider and the name of ODBC DSN like it is described in the referenced threads;
-- Use created ADO connection string to create ADO connection from your test code. Important requirement is that you must use TestComplete of the same bitness as installed MongoDB ODBC driver.