static private void setDB(int skipStage) {
        try {
            //First we try and see if we have our databasefile in the same working directory
            String pa = Paths.get("").toAbsolutePath().toString() + File.separator + "MICEDB.FDB";
            DB.setPath(pa);
        } catch (InfException e) { // we didnt have it in working directory, try to find it in a settingsfile.
            if (Files.exists(Paths.get("MICEsettings.ini"))) {
                try {//found settingsfile, trying to get path
                    DB.setPath(readDBFromSettingsFile());
                } catch (InfException ex) { // no valid path was found in settingsfile, show dialogue for user to chose where it is.
                    int chosen;
                    if (skipStage != 1) {
                        chosen = showDBOkDialoge();
                    } else {
                        chosen = 1;
                    }
                    if (chosen == 1) {
                        String dbPath = dbFileChooser();
                        try {
                            DB.setPath(dbPath);
                            writeDBToSettingsFile(dbPath);
                        } catch (InfException exe) {
                            showSureDialogue();
                        }

                    } else {
                        showSureDialogue();
                    }
                }

            } else {
                initSettingsFile(); //if no settingsfile was found, init one
                int chosen;
                if (skipStage != 1) {
                    chosen = showDBOkDialoge();
                } else {
                    chosen = 1;
                }
                if (chosen == 1) {
                    try {
                        String path = dbFileChooser();
                        DB.setPath(path);
                        writeDBToSettingsFile(path); //writing the path for later use
                    } catch (InfException ex) {
                        showSureDialogue();
                    }
                } else {
                    showSureDialogue();
                }
            }
        }
    }