Are there any current SQLite demos? lazarus / 16-Databases ---------------------------------------------------------------------- jbmckim · 2018-01-29 23:26 After having stepped through the SQL tutorial (tsqlscriptsample), it seems to be riddled with problems.  Most immediately notable is an 'EDataBaseError' of "Unknown connector type SQLite" thrown from TForm1.ConnectionTest.  (I encountered problems with all DB types but my interest is SQLite.) I did have a bit more success building the database manually (using sqlite3.exe) and running sqldbtutorial3 but that wound up not being able to find sqlite3.dll, no matter where it was located.  Is this a version issue?  Is there a property somewhere that needs to specify the dll location?   (See the resurrected thread https://forum.lazarus.freepascal.org/index.php/topic,19238.15.html re versioning.) Just looking for something that will open a db, query, write and close. Thanks. ---------------------------------------------------------------------- hakuna · 2018-01-30 02:12 jbmckim in what path are you putting the sqlite3.dll file? Please do the test by placing it in the root directory of your application, at the same level as the .exe file or in the C: \ Windows path. ---------------------------------------------------------------------- dbannon · 2018-01-30 03:12 Did you see - http://wiki.freepascal.org/SqlDBHowto and specifically http://wiki.fre epascal.org/SqlDBHowto#How_to_execute_direct_queries.2Fmake_a_table.3F These examples worked OK when I updated that page six or seven months ago. But be warned, at that time, it was my first play with Lazarus .... Davo ---------------------------------------------------------------------- Thaddy · 2018-01-30 07:29 Quote from: jbmckim on January 30, 2018, 12:26:23 amAfter having stepped through the SQL tutorial (tsqlscriptsample), it seems to be riddled with problems.  Most immediately notable is an 'EDataBaseError' of "Unknown connector type SQLite" thrown from TForm1.ConnectionTest.  (I encountered problems with all DB types but my interest is SQLite.) Maybe you mixed up Sqlite with Sqlite3? These are different: the former is Sqlite 2.X and the latter is Sqlite3. FPC supports both. ---------------------------------------------------------------------- jbmckim · 2018-01-30 19:18 Pt 1 solved.  Win 10 OS sees the sqlite3.dll if its in SysWOW64 but not if its co-located with the .exe...Thanks Bill Gates. dbannon - Examples you cite do work after pt. 1 above.  The app examples though seem to have major issues or the debugger is really confused.  Stepping through the code, it doesn't like the attributes of TSQLScript. Example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  OurScript: TSQLScript;begin  OurScript:=TSQLScript.Create(nil);  try  OurScript.Database:=FConn; //Indicate what db & ... Inspecting OurScript.Database, the debugger says that TSQLScript does not contain a .Database attribute.  Inspecting the class as presented by the debugger (by hovering), this is true. Sqlite vs. SQLite3.  The example uses 3: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i LoginForm.ConnectorType.AddItem('SQLite3', nil); This is the dll I've downloaded and as above, works with the other example. I'd say that from the time this example was created, things have changed.  This is at least true for the assumed target environment (i.e. the example is no longer "plug and play").  It would also seem to be the case that there's a disconnect between the source code and the current example set, at least as pertains to SQLite(3).  There are likely also problems with Firebird although I didn't spend much time looking at FB.  Probably its time to update the example(s). ---------------------------------------------------------------------- Jurassic Pork · 2018-01-30 21:05 hello, you can have a look to my database example (in Lazarus\examples\Database\Image_Mushrooms ) : Quote[MushRoomsDatabase by Jurassic Pork using SQLite - January 2014 Updated for Firebird Embedded - August 2014 Features: - Use SqlDb and lazreport components. - Sqlite3 or Firebird embedded database DeadlyMushrooms with 5 mushrooms. Sqlite3 will be tried first; if no Sqlite library is available, Firebird embedded will be tried. - It demonstrates: - creating a new SQLite3 database with table if the db does not exist - use of TSQLScript to run multiple SQL statements - use of FBAdmin to restore Firebird backup (smaller than the live .fdb file) on first run, useful for keeping your setup file small and compatible with older Firebird versions - The images are stored in blob field without extension at the beginning. With this you can view blob images with database browser editor (e.g. sqlite2009pro). - In the database there is also a field with images links (filenames). - The linked images are stored in the folder images of the project. - You can see the linked images in a Timage. - You can change the images in the database: - for Tdbimage (image in db): double click on the component and choose your image. - for Timage (linked image): click on the button near the image filename (you must be in edit mode). - Transaction commits when you click on Tdbnavigator refresh button or on close form. - Small pictures of the mushrooms are in the sqlite3Database. Largest images are in files in the folder images. - Print button to print all the mushrooms (lazreport). On each page you have: - a title. - the field common_name of the mushroom database. - the field notes of the mushroom database. - the field picture of the mushroom database (picture picture1). - the picture of the field image_link (picture picture2). The report name is Mushroom_Report.lrf You need to install Lazreport and sqldb packages for the example to work.  Works with Lazarus 1.8.0 Friendly, J.P ---------------------------------------------------------------------- jbmckim · 2018-01-31 00:09 Thanks Jurassic.  I will take a look at that as I'm in the "sandbox" stage at this point and different perspectives are appreciated. Here's what I was able to accomplish with help from here and perspiration - remember, this applies to sqlite3 1)  Move the sqlite(x).dll file to either System32 or SysWOW64. (This eliminates most major security hang ups on Windows.) 2)  To use the tutorial http://wiki.freepascal.org/SQLdb_Tutorial0, avoid the automatic DB creation.  Manually cut and paste the entries in Tutorial 1, using a tool of your choice. I used command line sqlite3 with PowerShell to create the database. 3)  This approach was successful for me navigating through the end of Tutorial1.  I assume the subsequent tutorials will work as well. thanks all ---------------------------------------------------------------------- egsuh · 2018-02-04 03:27 FYI: If your Windows is 64 bit, Windows\system32 or system folder contains 64-bit library files, and SYSWOW64 32-bit libraries. So if your  SQLite3 is 32-bit application then it must be in sysWOW64 folder, and system32 or system folder if SQLite3.dll is 64-bit library.