Hi,
I am writing some code to pull data from an ODBC connection. I want to test if the username and password entered are valid. The script is as follows:
dbc = Create Database Connection("Driver={Oracle in instantclient11_1}; DBQ=" || target || "; UID=" || user || ";PWD=" || pass || ";FBS=12800000;");
I found some solutions suggesting checking if dbc is empty to see if the connection was created as a way to check for the correct user and pass. However, when I enter the incorrect details for the username and password, I get an ODBC prompt to enter the correct username and password. I do not want this prompt and would like the script to run and return an empty dbc object.
The scripting index says I can use a boolean value after the connection string to disable the prompt:
dbc = Create Database Connection("Driver={Oracle in instantclient11_1}; DBQ=" || target || "; UID=" || user || ";PWD=" || pass || ";FBS=12800000;", 0);
However, running the above code results in the error:
Expecting DriverPrompt Boolean argument
I get the same error if I use true, false or As Boolean(0). Any help to solve this will be great. Alternatively, any other suggestions to validate the username and password for a DB connection are welcome.
Thanks!