function displayColTypes(c) { write("

") for (col in c) { write("
") write( "" + col + " " ) write(" | " + ( (typeof(c[col]) == "object") ? "date" : typeof(c[col]) ) + "") write("
") } write("

") } //displayColTypes function ES2displayColTypes(c) { write("

") for (col in c) { write("
") write( "" + col + " " ) write(" | string ") write("
") } write("

") } //ES2displayColTypes 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 if ( ( (request.SQL == null) || (request.SQL == "") ) && ( (request.update == null) || (request.update == "") ) ) write("

Error - No query or update defined.") if(!database.connected()) database.connect(project.dbType, project.dbServer, project.userName, project.password, project.dbName) /* else if (server.httpdlwVersion.indexOf("3.0") != -1) { // ----- for server 3.0: -------- db = project.sharedConnectionPool.connection("clientSideCursor", 30) if (!db.connected()) { write("Error: Unable to connect to database.") write("

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

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

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

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

Operation failed:
" + request.SQL + "
Status code: " + result) } 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) } } else { // ----- for server 2.0: -------- */ if (!database.connected()) { write("Error: Unable to connect 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 = database.cursor(request.SQL) displayQuery(curs) if (server.httpdlwVersion.indexOf("3.0") != -1) displayColTypes(curs) else ES2displayColTypes(curs) if (result != 0) write("

Operation failed:
" + request.SQL + "
Status code: " + result) } else if ( (request.update != null) && (request.update != "") ) { result = database.execute(request.update) if (result == 0) write("

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

Operation failed:
" + request.update + "
Status code: " + result) } //} if ( request.redirect != null ) { redirect( request.redirect ) }