Example #1
0
    def loadTLM(self):

        _ret = QtGui.QFileDialog.getOpenFileName(self, "Open TLM", "", "TLM (*.Tlm)")
        if (_ret == ""): return
        self.ui.lineEdit.setText(_ret)

        self.inputFile = _ret
        self.outputFile = self.inputFile+'3'
        if os.path.isfile(self.outputFile):
            _s = "new TLM3  " + self.outputFile + "  already exists"
            QtGui.QMessageBox.information(self, 'TMV3', _s, QtGui.QMessageBox.Ok)
            return

        _conI = pypyodbc.win_connect_mdb(self.inputFile)
        _curI = _conI.cursor()
        _curI.execute('SELECT [tTitle],[tComment],[lLimitID] from Limits')
        _ret = _curI.fetchall()
        print(_ret)
        self.tlmCount = 0
        for _f in _ret:
            self.addItem(self.tlmCount,_f[0],_f[0],'1.0',_f[1])
            _curI.execute('SELECT [dXValue],[dYValue] from LimitValues WHERE [lLimitID]={0}'.format(str(_f[2])))
            _list = _curI.fetchall()
            self.valueLists.append(_list)
            self.tlmCount +=1
            pass


        self.saveFlag = True
Example #2
0
 def __init__(self, mdbFile, pg_con_string):
     if isWindows():
         self.ac_con=pypyodbc.win_connect_mdb(mdbFile)
         self.ac_cur = self.ac_con.cursor()
     self.pg_con = psycopg2.connect(pg_con_string)
     self.pg_cur = self.pg_con.cursor()
     self.SQL="SET client_encoding = 'UTF8';\n"
Example #3
0
def db_connect(**kwargs):
    '''
        Takes DSN='connection name' or MDB='path to access file'
        returns a connection to the specified database.
        throws Keyerror if you provide the wrong thing.
        Throws pypyodbc connect error if connection string is not valid.
    '''
    if 'DSN' in kwargs:
        return db.connect('DSN=' + kwargs['DSN'], autocommit=True)
    if 'MDB' in kwargs:
        try:
            return db.win_connect_mdb(kwargs['MDB'])
        except:
            pass
        #try creating it then connecting
        db.win_create_mdb(kwargs['MDB'])
        return db.win_connect_mdb(kwargs['MDB'])
    else:
        raise KeyError('Provide either a DNS keyword or MDB keyword')
Example #4
0
def fetchFromDB(grade, department, entranceYear):
    try:
        conn = pypyodbc.win_connect_mdb('./XLDB.mdb')
        cur = conn.cursor()
        tree2.delete(*tree2.get_children())
        query = 'SELECT * FROM Users'
        needsAnd = False
        vals = []
        if grade.get() != 'all' or department.get() != 'all' or entranceYear.get() != 'all':
            query += ' WHERE'
        if grade.get() != 'all':
            needsAnd = True
            query += " Grade=?"
            vals.append(grade.get())
        if department.get() != 'all':
            if needsAnd:
                query += " AND Department=?"
                vals.append(department.get())
            else:
                query += " Department=?"
                vals.append(department.get())
            needsAnd = True
        if entranceYear.get() != 'all':
            if needsAnd:
                query += " AND EntranceYear=?"
                vals.append(int(entranceYear.get()))
            else:
                query += " EntranceYear=?"
                vals.append(int(entranceYear.get()))
        query += ';'
        global usersStdnums
        usersStdnums = {}
        cur.execute(query, vals)
        data = cur.fetchall().copy()
        if data:
            selectLabel.configure(
                text='Successfully fetched data from database.', foreground='green')
            for row in data:
                tree2.insert('', 0, text=str(row[15]), iid=str(row[15]), tag='green')
                usersStdnums[str(row[15])] = str(row[15])
            quotaLF2.state(['!disabled'])
            for widget in quotaLF2.winfo_children():
                widget.state(['!disabled'])
            treeLF2.state(['!disabled'])
            for widget in treeLF2.winfo_children():
                widget.state(['!disabled'])
            updateB.state(['!disabled'])
        else:
            messagebox.showinfo(title='No result',
                                message='The database returned no result.')
        cur.close()
        conn.close()
    except Exception as er:
        messagebox.showinfo(title='No result',
                                message='The database returned no result.')
Example #5
0
    def read(self,sourceDB):

        _conq = pypyodbc.win_connect_mdb(sourceDB)
        _curq = _conq.cursor()
        _curq.execute('SELECT [tTitle],[tComment],[lLimitID] from LIMITS')
        x = _curq.fetchall()
        for n in x:
            _curq.execute('SELECT [dXValue],[dYValue] from LIMITVALUES where [lLimitID] = {0} ORDER by [dXValue]'.format(str(n[2])))
            y = _curq.fetchall()
            print(x,y)

        _conq.close()
Example #6
0
    def loadTKR(self):

        _ret = QtGui.QFileDialog.getOpenFileName(self, "Open TKR", "I:\Datensätze\Wirtz", "TKR (*.Tkr)")
        if (_ret == ""): return
        self.ui.lineEdit.setText(_ret)

        self.inputFile = _ret
        self.outputFile = self.inputFile+'3'
        if os.path.isfile(self.outputFile):
            _s = "new TKR3  " + self.outputFile + "  already exists"
            QtGui.QMessageBox.information(self, 'TMV3', _s, QtGui.QMessageBox.Ok)
            return

        _conI = pypyodbc.win_connect_mdb(self.inputFile)
        _curI = _conI.cursor()
        _curI.execute('SELECT [tTitle],[tComment],[lAntennenKorrID] from AntennenKorr')
        _ret = _curI.fetchall()
        print(_ret)
        self.tkrCount = 0
        for _f in _ret:
            self.addItem(self.tkrCount,"Antenna",_f[0],_f[1])
            _curI.execute('SELECT [dXValue],[dYValue] from AntennenKorrValues WHERE [lAntennenKorrID]={0}'.format(str(_f[2])))
            _list = _curI.fetchall()
            self.valueLists.append(_list)
            self.tkrCount +=1

            pass

        _curI.execute('SELECT [tTitle],[tComment],[lKabelKorrID] from KabelKorr')
        _ret = _curI.fetchall()
        for _f in _ret:
            self.addItem(self.tkrCount,"Cable",_f[0],_f[1])
            _curI.execute('SELECT [dXValue],[dYValue] from KabelKorrValues WHERE [lKabelKorrID]={0}'.format(str(_f[2])))
            _list = _curI.fetchall()
            self.valueLists.append(_list)
            self.tkrCount +=1
            pass

        _curI.execute('SELECT [tTitle],[tComment],[lAdapterKorrID] from AdapterKorr')
        _ret = _curI.fetchall()

        for _f in _ret:
            self.addItem(self.tkrCount,"Adapter",_f[0],_f[1])
            _curI.execute('SELECT [dXValue],[dYValue] from AdapterKorrValues WHERE [lAdapterKorrID]={0}'.format(str(_f[2])))
            _list = _curI.fetchall()
            self.valueLists.append(_list)
            self.tkrCount +=1
            pass

        self.saveFlag = True
Example #7
0
    def __init__(self, dbname, template='SingleChannelTemplate.mdb'):
        import os
        import shutil
        self.dbname = dbname

        shutil.copy(template, dbname)
        directory = os.path.splitext(dbname)[0]
        self.directory = directory
        try:
            os.makedirs(self.directory)
        except:
            pass
        self.connection = pypyodbc.win_connect_mdb(dbname)
        self.cursor = self.connection.cursor()
def main():
    conn = pypyodbc.win_connect_mdb(config.PATH_MDB)
    # accdbは開けず、以下のエラーとなる
    # conn = pypyodbc.win_connect_mdb(config.PATH_ACCDB)
    # pypyodbc.Error: ('HY000', "[HY000] [Microsoft][ODBC Microsoft Access Driver] 
    # データベース '(不明)' を開くことができません。アプリケーションで認識できないデータベースであるか、
    # またはファイルが破損しています。 ")
    
    cur = conn.cursor()
    cur.execute("select item_name from item")
    
    for c in cur.fetchall():
        print(c[0]) #=> `hoge`, `fuga`
        
    cur.close()
    conn.close()
Example #9
0
def updateDB():
    try:
        a = int(credit2.get()) + int(maxCredit2.get()) + int(minCredit2.get())
        + int(sheetCredit2.get()) + int(sheetMax2.get()) + int(discount2.get())
    except:
        messagebox.showerror(title='Invalid input',
                             message='Some of the entries of credits section are not valid.')
    else:
        selectionIIDs = [x for x in tree2.tag_has(
            'green') if not tree2.get_children(x)]
        if selectionIIDs:
            conn = pypyodbc.win_connect_mdb('./XLDB.mdb')
            cur = conn.cursor()
            for item in selectionIIDs:
                val = [
                    int(credit2.get()),
                    int(maxCredit2.get()),
                    int(minCredit2.get()),
                    int(sheetCredit2.get()),
                    int(sheetMax2.get()),
                    int(discount2.get()),
                    usersStdnums[item]
                ]
                query = '''
                    UPDATE Users
                    SET
                    Credit=Credit + ?,
                    maxCredit=maxCredit + ?,
                    minCredit=minCredit + ?,
                    paperCredit=paperCredit + ?,
                    maxPaperCredit=maxPaperCredit + ?,
                    Discount=Discount + ?
                    WHERE
                    userName=?;
                '''
                cur.execute(query, val)
                cur.commit()
            messagebox.showinfo(title='Successful operation',
                                message='All of the selected entries updated.')
            cur.close()
            conn.close()
        else:
            messagebox.showinfo(title='Empty selection',
                                message='No one of the entries selected. Please select at least one.')
Example #10
0
def sqlite3_from_mdb(mdbfilepath, tableName, model):
    # копіює всі дані з таблиці mdb в таблицю sqlite3
    pypyodbc.lowercase = False
    connection = pypyodbc.win_connect_mdb(mdbfilepath)
    cursor = connection.cursor()
    fields = "*"
    condition = ""
    sqlcommand = "SELECT %s FROM %s %s" % (fields, tableName, condition)
    cursor.execute(sqlcommand)

    print('-'*50)
    attr = False
    while True:
        row = cursor.fetchone()
        if not row: break
        print('row=', row)
        m = model()
        if not attr:
            attr = True
            coldict, collist = rowAttributes(row)
        # print(coldict)
        # print(collist)
        for field in m.mdbFields:
            # print(field, m.mdbFields[field])
            if row[coldict[m.mdbFields[field]]]:
                setattr(m, field, row[coldict[m.mdbFields[field]]])
        for field in m.mdbFields:
            print('%20s | %s' % (field, getattr(m, field)))
        m.save()
        print('m.id=', m.id)
        print('-'*50)
        # input()

    print('-'*50)

    cursor.close()
    connection.commit()
    connection.close()
 def __init__(self, bws_file, file_prefix,
              section_number=0, max_round=0):
     """Construct parser object."""
     log.getLogger('init').debug('reading BWS file: %s', bws_file)
     with pypyodbc.win_connect_mdb(bws_file) as connection:
         cursor = connection.cursor()
         if max_round == 0:
             max_round = sys.maxint
         criteria_string = ' WHERE '
         criteria_string += 'Section = %d' % section_number \
                            if section_number > 0 else '1 = 1'
         criteria_string += ' AND Round <= %d' % max_round
         self.__lineup_data = cursor.execute(
             'SELECT * FROM RoundData' + criteria_string
         ).fetchall()
         bid_data = cursor.execute(
             'SELECT * FROM BiddingData' + criteria_string
         ).fetchall()
         erased_boards = cursor.execute(
             'SELECT * FROM ReceivedData ' + criteria_string + ' AND Erased'
         ).fetchall()
     log.getLogger('init').debug('parsing lineup data (%d entries)',
                                 len(self.__lineup_data))
     self.__round_lineups = parse_lineup_data(self.__lineup_data)
     log.getLogger('init').debug('parsing bidding data (%d entries)',
                                 len(bid_data))
     self.__bids = parse_bidding_data(bid_data, erased_boards)
     log.getLogger('init').debug('parsing prefix, filename = %s',
                                 file_prefix)
     self.__tournament_prefix = path.splitext(
         path.realpath(file_prefix))[0]
     log.getLogger('init').debug('prefix = %s', self.__tournament_prefix)
     self.__tournament_files_match = re.compile(
         re.escape(self.__tournament_prefix) + r'([0-9]{3})\.html')
     log.getLogger('init').debug('tournament files pattern: %s',
                                 self.__tournament_files_match.pattern)
     self.__map_board_numbers()
Example #12
0
        sma_temp = sma_temp + data["candles"][4000 - index- i][strC]
    return sma_temp/num
n = 50
last_i = 0
spacer = 5

cntr = 0
last_ID = 0
LowerBand = []
UpperBand = []
Return_Avg = []
Return_SD = []

file_Name = "C:\Users\macky\OneDrive\Documents\Price_Database.mdb"

conn = pypyodbc.win_connect_mdb(file_Name)  

cur = conn.cursor()

#cur.execute(u"""CREATE TABLE Return_Data (ID INTEGER PRIMARY KEY, N Integer, R Double)""")
#cur.commit()

cur.execute("DELETE * FROM Return_Data")
cur.commit

p = 0
ID = 1
r = -0.002
for i in range(101,4500):
    aavg = 0.0
    ssd = 0.0
Example #13
0
def addToDB():
    if not (credit.get().isdigit() and maxCredit.get().isdigit() and minCredit.get().isdigit()
            and sheetCredit.get().isdigit() and sheetMax.get().isdigit() and discount.get().isdigit()):
        messagebox.showerror(title='Invalid input',
                             message='Some of the entries of credits section are not valid.')
    selectionIIDs = [x for x in tree.tag_has(
        'green') if not tree.get_children(x)]
    selection = [tree.item(x) for x in selectionIIDs]
    if selection:
        i = 0
        j = 0
        conn = pypyodbc.win_connect_mdb('./XLDB.mdb')
        cur = conn.cursor()
        mp = {
            'B.Sc': 'bs',
            'M.Sc': 'ms',
            'Ph.D': 'phd'
        }
        depQuery = "SELECT DepartmentName FROM Departments;"
        cur.execute(depQuery)
        dep = cur.fetchall()[0][0]
        for item in selection:
            checkQuery = "SELECT * FROM Users WHERE userName=?;"
            l = []
            l.append(str(usersDictionary[item['text']]['cn'][0]))
            cur.execute(checkQuery, l)
            if not len(cur.fetchall()):
                i += 1
                val = [
                    usersDictionary[item['text']]['givenName'][0], # firstname
                    usersDictionary[item['text']]['sn'][0], # lastname
                    dep, # department
                    mp[usersDictionary[item['text']]['dn'].split(',')[2][3:]], # grade
                    int(discount.get()), # discount
                    int(sheetCredit.get()), # paper_credit
                    int(credit.get()), # credit
                    int(minCredit.get()), # min_credit
                    True, # enabled
                    int('13' + usersDictionary[item['text']]['cn'][0][:2]), # entrance_year
                    str(usersDictionary[item['text']]['cn'][0]), # username
                    datetime.now(), # add_date
                    int(maxCredit.get()), # max_credit
                    int(sheetMax.get()) # max_paper_credit
                ]
                query = '''
                    INSERT INTO Users
                    (
                        Name,
                        Family,
                        Department,
                        Grade,
                        Discount,
                        paperCredit,
                        Credit,
                        minCredit,
                        Enabled,
                        EntranceYear,
                        userName,
                        addDate,
                        maxCredit,
                        maxPaperCredit
                    )
                    VALUES
                    (
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?,
                        ?
                    );
                '''
                cur.execute(query, val)
            else:
                j += 1
        cur.commit()
        cur.close()
        conn.close()
        if i == 0:
            messagebox.showinfo(title='Successful operation',
                                message='All of the selected entries exist in the database. No entry added to database.')
        elif j == 0:
            messagebox.showinfo(title='Successful operation',
                                message='All of the selected entries added to database.')
        else:
            messagebox.showinfo(title='Successful operation',
                                message=str(i) + ' entries of ' + str(i + j) + ' entry added to database.')
    else:
        messagebox.showinfo(title='Empty selection',
                            message='No one of the entries selected. Please select at least one.')
Example #14
0
                    k = k+1
                    j = j+1
                elif(len(word_entered) > len(passed_word)):
                    word_entered = word_entered[0:j] + word_entered[(j+1):]
                else:
                    word_entered = word_entered[0:j] + passed_word[k] + word_entered[(j+1):]
                    k = k+1
                    j = j+1
                print word_entered
                operations = operations + 1
    probability = (float)(operations) / ((float)(length) * (float)(similar))
    print (probability)
    probability_of_words.append(probability)


conn = pypyodbc.win_connect_mdb('F:\\Dictionary')
cur1 = conn.cursor()

print("Words available in the dictionary")

SQL = 'SELECT * FROM WORDS ORDER BY STRINGS'
cur1.execute(SQL)

for row in cur1.fetchall():
    for field in row:
        print field

word = raw_input("Enter word")
word = word.upper()
temp = ""
temp = word[0]
Example #15
0
 def CreateAccessDatabase(self, fname):
     pypyodbc.win_create_mdb(fname)
     connection = pypyodbc.win_connect_mdb(fname)
     connection.cursor().execute('CREATE TABLE t1 (id COUNTER PRIMARY KEY, name CHAR(25));').commit()
     connection.close()
Example #16
0
        "dive",
        "haulout",
        "haulout_orig",
        "summary",
        "tag_info",
        "uplink",
    )

    # msdb_tables = ('ctd','deployments','dive','gps','haulout',
    #              'haulout_orig','sms','summary','tag_info','uplink')

    # If pandas/pickly object doesn't exist, create
    # if not os.path.isfile(bin_file):

    # Connect to MS Access database & create cursor
    connection = pypyodbc.win_connect_mdb(msdb_file)
    cursor = connection.cursor()

    # h5file = tables.openFile(bin_file, mode='w', title=msdb_name)

    h5file = h5py.File(bin_file, "w")

    for table in msdb_tables:

        print table + "1"

        # Append table to HDF5 File
        process_cursor(cursor, h5file, table)

    h5file.close()
    connection.close()
Example #17
0
def getAccessConn(path):
    conn = pypyodbc.win_connect_mdb(path)
    return conn
Example #18
0
    def convert(self):
        _t = time.gmtime(os.path.getmtime(self.inputFile))
        self.tdsDate = time.strftime('%Y-%m-%d %H:%M:%S', _t)

        _conI = pypyodbc.win_connect_mdb(self.inputFile)
        _curI = _conI.cursor()

        try:
            _conz = lite.connect(self.outputFile)
            _curz = _conz.cursor()

            _conq = pypyodbc.win_connect_mdb(self.inputFile)
            _curq = _conq.cursor()
            _curq.execute('SELECT [tTitle],[tEUT],[tComment],[tVersion],[bNATO] from Plan')
            _plan = _curq.fetchall()
            print (_plan)

            _curz.execute("INSERT INTO Plan (Title,TMVVersion,Version,Date,NATO,Company,Comment) VALUES (?,?,?,?,?,?,?)",
                          (str(_plan[0][0]), '2',str(_plan[0][3]),str(self.tdsDate),str(_plan[0][4]),'BSI',str(_plan[0][2])))

            _conz.commit()
            _rowIDPlan = _curz.lastrowid
            print(_rowIDPlan)
            _blob = ''.join(self.rtFileData)
            _curz.execute("INSERT INTO Files (Title,Type,Data) VALUES (?,?,?)",
                          (self.rtFileName, "Routine", _blob))
            _blob = ''.join(self.drFileData)
            _curz.execute("INSERT INTO Files (Title,Type,Data) VALUES (?,?,?)",
                          (self.drFileName, "Driver", _blob))

            _conz.commit()



            _curq.execute('SELECT * from Routinen')
            _routinen = _curq.fetchall()

            for n in _routinen:
                print(n)
                _routineID = n[0]
                _curz.execute("INSERT INTO Plots (PlanID,Title,X1,X2,Y1,Y2,Log,Unit,Annotation,[Order],Comment) VALUES (?,?,?,?,?,?,?,?,?,?,?)",
                          (str(_rowIDPlan), str(n[2]),str(n[3]),str(n[4]),str(n[5]),str(n[6]),str(int(n[8])),str('dBµV'),str(n[11]),str(n[16]),str(n[13])))
                _conz.commit()
                _rowIDPlot = _curz.lastrowid
                print(_rowIDPlot)

                _curq.execute('SELECT [tTitle] FROM Limits WHERE [lRoutineID]={0}'.format(str(_routineID)))
                _limits = _curq.fetchall()
                # add version
                _lim = []
                _e = '0','0'

                for _x in _limits:
                    _lim.append((_x[0],'1.0'))

                _curz.execute("INSERT INTO Routines (PlotID,Title,Device1,SignalClass,[Order],Comment,Limits) VALUES (?,?,?,?,?,?,?)",
                          (str(_rowIDPlot), self.rtFileName,self.drFileName,str(n[14]),str(n[16]),str(n[13]),str(_lim)))
                _conz.commit()
                _rowIDRoutine = _curz.lastrowid
                print(_rowIDRoutine)

                _curq.execute('SELECT * from Settings WHERE [lRoutineID]={0}'.format(str(_routineID)))
                _settings = _curq.fetchall()

                for i in _settings:
                    _settingID = i[0]
                    _curz.execute("INSERT INTO Settings (RoutineID,[Order],StartFreq,StopFreq,Title,Step,StepWidth,StepTime,Route) VALUES (?,?,?,?,?,?,?,?,?)",
                          (str(_rowIDRoutine), str(int(i[23])),str(i[3]),str(i[4]),str(i[2]),'0','0',str(i[9]),str(i[17])))
                    _conz.commit()
                    _rowIDSetting = _curz.lastrowid
                    print(_rowIDSetting)
                    _curz.execute("INSERT INTO [Commands] ([SettingID],[Order],[Command],[Parameter]) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),str('1'),str('set_StartFreq'),str(i[3])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'2','set_StopFreq',str(i[4])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'3','set_ResBW',str(i[5])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'4','set_VidBW',str(i[6])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'5','set_Attenuator',str(i[10])))
                    if n[15] == "FSET":
                        _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                       (str(_rowIDSetting),'6','set_PreSelector',str(i[15])))
                        _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                       (str(_rowIDSetting),'7','set_PreAmplifier',str(int(i[11]))))
                    else:
                        _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                       (str(_rowIDSetting),'6','set_PreSelector',str(int(i[12]))))
                        _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                       (str(_rowIDSetting),'7','set_PreAmplifier',str(int(i[13]))))

                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'8','set_RefLevel',str(i[8])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'9','set_Detector',str(i[22])))
                    _curz.execute("INSERT INTO Commands (SettingID,[Order],Command,Parameter) VALUES (?,?,?,?)",
                                   (str(_rowIDSetting),'10','set_StepTime',str(i[9])))
                    _conz.commit()

                    _curq.execute("SELECT * FROM Traces WHERE [lSettingID]={0}".format(str(_settingID)))
                    _traces = _curq.fetchall()

                    for j in _traces:
                        _curz.execute("INSERT INTO Traces (SettingID,StartFreq,StopFreq) VALUES (?,?,?)",
                          (str(_rowIDSetting), str(int(j[2])),str(j[3])))
                        _conz.commit()




    #    for n in x:
    #        _curq.execute('SELECT [dXValue],[dYValue] from LIMITVALUES where [lLimitID] = {0} ORDER by [dXValue]'.format(str(n[2])))
    #        y = _curq.fetchall()
    #        print (str(n[0]))
    #        print (str(mDate))
    #        print (str(n[1]))
    #        print(str(y))
    #        _curz.execute("INSERT INTO Limits (Title,Date,Comment,DataXY) VALUES (?,?,?,?)", (str(n[0]), str(mDate),str(n[1]),str(y)))
    #        _conz.commit()

    #    _conz.close()
        except Exception as _err:
            print(_err)
            QtGui.QMessageBox.information(self, 'TMV3', str(_err), QtGui.QMessageBox.Ok)
            return (False)
        return True