JScript: ActiveXObject("ADODB.Connection") - Help Please
I am trying to connect to a server but i keep getting exception errors at the certain point in my routine. I have arrowed where the error occurs.
Code:
function dbConnect(sDBDriver, sDBServer, sUID, SPWD, sDBName) {
var sConX;
var sException;
sConX = "DRIVER=" + sDBDriver + ";SERVER=" + sDBServer + ";UID=" + sUID + ";PWD=" + sPWD + ";DBNAME=" + sDBName + ";"
try {
window.status = "Creating object";
oDBConn = new ActiveXObject("ADODB.Connection");
} catch(sException) {
window.status = "Exception: Error creating object - " + sException;
return(false);
}
try {
window.status = "Connecting..."
>>>> oDBConn.Open(sConX); <<<<
} catch(sException) {
// Exception error caught
window.status = "Exception: Error connecting to server - " + sException;
return(false);
}
return(true); // Success connecting to server.
}
I have tried other methods but none seem to work for me. The error is an Object Error.