SQLite3 encrypted database problems lazarus / 16-Databases ---------------------------------------------------------------------- HatForCat · 2015-04-03 23:38 Hi, Just trying Lazarus, been using Delphi since it was invented. Yup, that old! I want to use a fairly basic encrypted database and I am most familiar with using SQLite3, but never with encryption. Generally I just encrypted the critical data before the Post and decrypted on the fly. I have installed the demo from here... http://forum.lazarus.freepascal.org/index.php/topic,25124.msg152239.ht ml#msg152239 but two major issues. It compiles and runs OK, but when I click "Make new database" it says "Unable to create database." The big problem is that I can set break-points, but they are all ignored at run-time. I assume it is something I have not set correctly within Lazarus. Could someone please assist with either or both these issues. OR Please suggest an alternative free database Component that can be encrypted. Thanks ---------------------------------------------------------------------- engkin · 2015-04-04 00:05 QuoteThe big problem is that I can set break-points, but they are all ignored at run-time. Project - Project Options:   Compiler Options - Debugging - check "Generate debugging info for ... " Quotewhen I click "Make new database" it says "Unable to create database." Do you have sqlite dll visible to your exe? ---------------------------------------------------------------------- HatForCat · 2015-04-04 00:43 Thanks for the quick reply. Your help allows me to step and yes, I have the sqlite3.dll in the same Folder as the test project. I am using the "SQLite.Interop.dll" renamed as "sqlite3.dll" as per the instructions and now that I can step, that's what is causing the issue. If I use a standard sqlite3.dll it works but (naturally) the data is not being encrypted. It looks like I need a functioning version of the sqlite3.dll that incorporates encryption. Where do I go from here? Thanks ---------------------------------------------------------------------- engkin · 2015-04-04 01:25 Quote from: HatForCat on April 04, 2015, 02:43:56 amI am using the "SQLite.Interop.dll" renamed as "sqlite3.dll" as per the instructions and now that I can step, that's what is causing the issue. If I use a standard sqlite3.dll it works but (naturally) the data is not being encrypted. It looks like I need a functioning version of the sqlite3.dll that incorporates encryption. Where do I go from here? It seems to me that your SQLite.Interop.dll depends on other files that you do not have. Most likely you missed this part: QuoteFor instance, if you have the latest version of the .NET framework installed on your computer (4.5.1) and the Visual Studio 2013 Redistributable Package, then you should be able to use this: http://system.data.sqlite.org/downloads/1.0.93.0/sqlite- netFx451-binary-x64-2013-1.0.93.0.zip. Just extract the SQLite.Interop.dll and rename it to sqlite3.dll and place it in the local directory. Again, you'll want to download a version that matches the version of .NET and Visual C++ Runtime on your computer (you may have many/all the versions of .NET and VC++ Redists installed). You can download various versions of the .NET framework at http://msdn.microsoft.com/en-us/vstudio/aa496123.aspx You can download various versions of the Visual C++ Redistributables at http://support.microsoft.com/kb/2019667 And it goes without saying to use the correct 32/64bit version as your application. ---------------------------------------------------------------------- LacaK · 2015-04-04 06:49 And do you want do encryption/decryption in your own program or do you are looking for SQLite with build-in encryption ? So encryption is transparent to your program. AFAIK ebcryption is not a part of standard SQLite, so you neeed any kind of "extension" If second ten try google for "SQLite encryption" ---------------------------------------------------------------------- HatForCat · 2015-04-04 14:49 Quote from: engkin on April 04, 2015, 03:25:36 amIt seems to me that your SQLite.Interop.dll depends on other files that you do not have. Most likely you missed this part: Nope. If you check my OP you will see I have been programming for fun and profit for 40+ years. I actually read instructions, in fact spent 6-years of my working-life writing instruction manuals for programmers and IT professionals. Quote from: engkin on April 04, 2015, 03:25:36 amAnd it goes without saying to use the correct 32/64bit version as your application. and it goes without saying, I am using 32-bit for both. How do I know? Well when reading the instructions for installing Lazarus yesterday, it said something along the lines of, "unless you really need to build and compile 64-bit apps, then use 32-bit-installation." So here sits Lazarus in a VMWare Player under 32-bit win7. I appreciate your detailed help, but I am not a beginner at programming. Just a beginner with Lazarus. I am well aware of extensions to SQLite for full data file encryption, but I am trying to make this demo work as it will be a lot easier than using D2007 and starting from scratch. I may be better off looking at OTFE kind of thing. Never tried it, but might be a more simple approach to what I am trying to do. ---------------------------------------------------------------------- engkin · 2015-04-04 15:48 Quote from: HatForCat on April 04, 2015, 04:49:01 pmQuote from: engkin on April 04, 2015, 03:25:36 amIt seems to me that your SQLite.Interop.dll depends on other files that you do not have. Most likely you missed this part: Nope. If you check my OP you will see I have been programming for fun and profit for 40+ years. I actually read instructions, in fact spent 6-years of my working-life writing instruction manuals for programmers and IT professionals. I'm sorry, obviously I passed the wrong message. I did not doubt your knowledge or experience. I meant to say that I suspect the problem is related to having wrong combination of SQLite.Interop.dll and .NET framework. Quoting again what I saw from the link you posted earlier: Quoteyou'll want to download a version that matches the version of .NET and Visual C++ Runtime on your computer Before this thread I had now idea what .NET framework version I have on my system. ---------------------------------------------------------------------- HatForCat · 2015-04-04 17:59 Thanks again, I was not taking the comments too seriously. As you have probably discovered all is revealed within the "Programs and Features" section. I have 2.0, 2.5. 3.0 4.0 and 4.5 ---------------------------------------------------------------------- engkin · 2015-04-05 02:16 Quote from: HatForCat on April 04, 2015, 07:59:44 pmI have 2.0, 2.5. 3.0 4.0 and 4.5 What about "Visual C++ Runtime" files: .NET Framework 2.0 SP2   Visual C++ 2005 SP1 runtimeSQLite.NET Framework 4.0Visual C++ 2010 SP1 runtimeSQLite.NET Framework 4.5Visual C++ 2012 Update 4 runtime    SQLite