I want to run the following code:
$dll = [System.Reflection.Assembly]::LoadWithPartialName("System.Data.SQLite")
# [System.Reflection.Assembly]::LoadFrom("C:\Program Files\System.Data.SQLite\bin\System.Data.SQLite.dll")
$ConnectionString = "Data Source=C:\Var\sqlite_ff4\places.sqlite"
$conn = New-Object System.Data.SQLite.SQLiteConnection
$conn.ConnectionString = $ConnectionString
$conn.Open()
$sql = "SELECT * from moz_bookmarks"
$cmd = New-Object System.Data.SQLite.SQLiteCommand($sql, $conn)
# $cmd.CommandTimeout = $timeout
$ds = New-Object system.Data.DataSet
$da = New-Object System.Data.SQLite.SQLiteDataAdapter($cmd)
$da.fill($ds)
$conn.close()
$ds.tables[0]
At the line
$conn.Open()
I get the error
Exception calling "Open" with "0" argument(s): "File opened that is not a database file
file is encrypted or is not a database"
At line:5 char:11
+ $conn.Open <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
The file places.sqlite
is from Firefox 4.0. I'm using http://sourceforge.net/projects/sqlite-dotnet2/files/.
EDIT:
The above works for the Firefox 3.0 file places.sqlite
. Something seems to be different with Firefox 4.0.
It doesn't seem to be a password problem, but a version problem. Thanks to this Stack Overflow post I found, that I need SQLite 3.7.
I hope I find some current ADO provider.
sqlite-dotnet-x86-1006900.exe from here doesn't work
Exception calling "Open" with "0" argument(s): "Unable to load DLL 'SQLite.Inte rop.DLL': The specified module could not be found. (Exception from HRESULT: 0x8 007007E)"
It is possibly a debug build. Are there any prebuild version without an SQLite.Interop.DLL?