简体   繁体   中英

IronPython: SQLite error (26): file is encrypted or is not a database

I am testing the Iron Python to connect to a base SQLITE3 by running Visual Studio 2010 Ultimate and I've got this error:

"SQLite error (26): file is encrypted or is not a database"

My Workstation Win7_x64, is System.Data.SQLite_x86 (netFx40-setup-sqlite-bundle-1.0.79.0-x86-2010)

Please I need help.

I've created a new base with the "SQLite Data Browser".

My script is:

def RunQuery(self, query):
    conn = SQLiteConnection("Data Source=" + self._path + ";Version="+self._version+";Password="+self._password)
    conn.Open()
    set = DataSet()
    adapter = SQLiteDataAdapter(query, conn)

    try:
        adapter.Fill(set)
    finally:
        conn.Close()

    return set
Sorry the previous message! It was sent from a mobile phone.

Thanks to resolve the problem. The error was in the method call "SQLiteConnection" with password:

of:

SQLiteConnection ("Data Source =" + + self._path ", Version =" + + self._version ", Password =" + self._password)

to:

SQLiteConnection ("Data Source =" + + self._path ", Version =" self._version + + ";")

In SQLite3, does not need password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM