function getES2Connection(s) { params = new Object() n = 0 alert("LENGTH is " + s.length) while (s.length > 0) { params[n] = s.substring(s.lastIndexOf("\\")+1, s.length) s = s.substring(0, i) n++ } database.connect(params[0], params[1], params[2], params[3], params[4]) } function displayQuery(c) { write("

") write("
") for (col in c) write( "" + col + " " ) write("
") while (c.next()) { write("
") for (col in c) write("" + c[col] + "") write("
") } write("

") } //displayQuery function SQLExec(params) { if ( ( (request.SQL == null) || (request.SQL == "") ) && ( (request.update == null) || (request.update == "") ) ) write("

Error - No query or update defined.") if (server.httpdlwVersion.indexOf("3.0") != -1) { db = params.database } else { getES2Connnection(client.currentConnection) db = database } if (!db.connected()) { write("Error: Not connected to database.") write("

Major Error Message: " + database.majorErrorMessage() ) write("

Minor Error Message: " + database.minorErrorMessage() ) write("

Major Error Code: " + database.majorErrorCode() ) write("

Minor Error Code: " + database.minorErrorCode() ) } if ( (request.SQL != null) && (request.SQL != "") ) { curs = db.cursor(request.SQL) displayQuery(curs) } else if ( (request.update != null) && (request.update != "") ) { result = db.execute(request.update) if (result == 0) write("

Operation successful:
" + request.update) else write("

Operation failed:
" + request.update + "
Status code: " + result) } }