rohini11
4 years agoNew Contributor
Connect to Mysql DB and write query to verify data
Hi, Im looking for a function to connect to MYsql Db
and write query to verify data
function connDB() {
// Create and open a connection to the OrdersDB.mdb database
var connection = getActiveXObject("ADODB.Connection");
Connection.connectionString = "Provider=MSDASQL;Driver={MySQL ODBC 8.0 ANSI Driver};[Server="");Database="";User="";password=""Option=3;"; // use above format with your server/db details and assign the string value to this variable
connection.Open();
var rs = getActiveXObject("ADODB.Recordset");
rs.Open('select count(distinct STORE_CODE),CLAIM_PAY_DATE from eyos_dwh_uat.aud_campaign_claims where CLAIM_PAY_DATE ="2021-01-16"; ', connection);
connection.close;
}
ReferenceError: Connection is not defined
Please let me know if i can do database connection by project variables
thanks