Форум сайта python.su
Всем привет!
У меня отрабатывает скрипт
import sqlite3 connection = sqlite3.connect("test.db") cursor = connection.cursor() cursor.execute('CREATE TABLE people (first_name text, last_name text, age real)') cursor.execute("INSERT INTO people VALUES ('Anton', 'Ivanov', 32)") connection.commit() cursor.execute('select * from people') result = cursor.fetchall() print(result) cursor.close() connection.close()
connection = pyodbc.connect('DRIVER={SQLite3 ODBC Driver}; Direct=True; Database=test.db;String Types= Unicode') cursor = connection.cursor() cursor.execute('select * from people') result = cursor.fetchall() print(result)
InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
pyodbc.drivers()
['SQL Server']
Офлайн
Офлайн