KeyWild SQLite

 

http://www.keywild.com/SQLite

Public Domain Software

Author: Lewis Balentine

“Engineering is the art of planning and forethought.”

Legal Disclaimer:

The author makes no representation or warranty, either expressed or implied, with respect to the data files and/or software, their quality, accuracy, or fitness for any specific application. Therefore the author shall have no liability to any person or any entity with respect to any liability, loss, or damage caused or alleged to have been caused directly or indirectly by the use of the data files and/or software. This includes, but is not limited to, interruption of service, loss of data, loss of consulting or anticipatory profits or consequential damages from the use of these data files and/or software.

 

All files unless otherwise noted are the original work product of the author. Unless otherwise noted these files are placed into the Public Domain for the unrestricted use by anyone for any purpose. Placing these files in the public domain shall in no way be construed as an obligation of the author (or his heirs and/or assigns) to maintain the web site, web pages, files, data or software. Further it shall in no way limit the author’s (or his heirs and/or assigns) options to make, produce or use versions of the software, data files, CAD objects or other material posted under the URL  in any other commercial or non-commercial venture.

 

In the event of a legal dispute the court is requested to use a “reasonable person’s” interpretation of the “clear intent” of this disclaimer.

 

The use of these data files and/or software constitutes acceptance of this disclaimer.

“No good deed goes unpunished.” ― Oscar Wilde

SQLite 3.X Projects:

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL cross-platform database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain. It is known to be used by Adobe, Dropbox, Intuit and Google.

 

I was looking for a file based database engine other than MS-Access because Microsoft has a tendency to upgrade their products such that new versions are incompatible with the older versions. They may also drop support for given product and ACCESS is not supported across platforms. What you have here is a couple of code projects I did to learn how to access the SQLite DB engine. The DB engine is available as source, ODBC, DLL, ADO.Net or as Shell program.

Download Files:

SQLite 3 Example

Visual Basic 2013

(Run Time Parameters)

 

 

This is a simple SQLite 3.x database browser (read only). It was created in Visual Basic (Microsoft Visual Studio 2013 Professional) in order to develop a single function that could be used to either issue a SQL command or access a set of database records. While there are many examples of use the Visual designer to connect a DataViewGrid to a data source at design time there are very few (I only found one other) on how to connect a DataViewGrid to a data source at Run Time. This application demonstrates that as well as how to extract information from the table without using a GUI control. The function SQL3GetDataTable takes the name of the database file and a SQL query as input. It returns a DataTable object that may be connected to a data control or used to extract, edit, add or delete records. Error handling is implemented and populates two public variables: one with the error code, the other with the error message. All the needed code is encapsulated in a single function that can be copied directly into your program to get your SQLite application up and running quickly. Clicking on any cell will show information about the data in that cell. Also demonstrated is how to extract an Image from a DataViewGrid. The application has been tested and confirmed to run on Windows XP, Windows7 and Windows 8.1 (32 and 64 bit modes) with Microsoft Net.Framework 4.0. It uses the INTEROP version of the SQLite ADO.Net database engine. The following files are designated to be PUBLIC DOMAIN.

 

Binary Install (1.4 MB):

This is the standard Microsoft visual studio generated MSI install for the application that places a version of the program in the user’s space..

          SQLiteExample(VB2013)_Install.zip

 

Portable Binary (1.1 MB):

This is portable version of the application (i.e. it should run on any windows machine with Net Frameworks 4.0 installed). Unzip this and run the program SQLiteExample(VB2013).exe.

          SQLiteExample(VB2013)_Bin.zip

 

VB2013 Project (28 KB):

This is Visual Studio 2013 Project folder. You will need to use Microsoft’s NUGET package manager to add the SQLite Interop libraries.

          SQLiteExample(VB2013)_Project.zip

 

VB2013 Form1 (7 KB):

This is Visual Studio 2013 Project Form1. This has all the source code and comments. You could reconstruct the project from this file if really wanted to.

          SQLiteExample(VB2013)_Form1.zip

 

Sql3GetDataTable (1 KB):

This is code for the main function stripped of all comments and other wasted space. It is intended to be pasted into the code of a new project.

          SQLiteExample(VB2013)_Sql3GetDataTable.zip

 

Sample Data Base (283 KB):

This is a populated copy of the famous “NorthWin” Data Base as a SQLite 3.X DB file. This particular version includes some low resolution pictures.

           SQLiteExample(VB2013)_SampleDB.zip

 

SQLite For FreeBasic

 

 

FreeBASIC is a free/open source (GPL), 32-bit BASIC compiler for Microsoft Windows, DOS and Linux. It is excellent for producing small, fast, portable, standalone console applications (it can produce GUI programs and DLLs as well).

 

FreeBasic comes with a library to access the SQLite databases but it is a tad sparse on functions and examples of using the code. This project includes a file called SQLite_Functions.Bas that provides addition functions for working with the SQLite DB. A second file called “DemoSubs.bas” provides examples of using those functions. Both files are linked in the SQLite_Main.bas file. A compiled binary EXE is provided as well. The functions are documented in the file “SQLite_FreeBasic_Stub.pdf”. All files are included in the ZIP archive.

 

PDF Document (458 KB):

This is the PDF documentation for the added function. It can be read online

           SQLite_FreeBasic_Stub.pdf

 

Source of Course (711 KB):

This file contains the source code, exe, sample DB and PDF document.

           SQLiteForFreeBasic.zip

 

ScitillaNet SandBox

 

 

Scintilla is a syntax highlighting source code editing control available for Windows, Linux and OSX operating systems that supports over 80 programing languages. ScintillaNet is a Net Frameworks wrapper for the Scintilla.dll. I wanted to use this software with a SQLite project. ScintillaNet implemented a custom XML based configuration to allow the control to be used with languages that do not have support built into the basic Scintilla.dll. Unfortunately there is sparse documentation on the creation and use of these XML files.

One of the big problems in creating a new ScintillaNet XML file is determining what Lexer to use and finding out what styles are available with the Lexer and more specifically what they are used for. This application was created to address that problem.

 

Documentation (1.25 MB):

This is the documentation for the application. It can be read online

           SandBox.pdf

 

Binary (618 KB):

This Zip file contains the Application program, Scintilla.dll, ScintillaNet.dll and XML files (including the SQLite.xml file). This is a portable version of the application. It does require that Microsoft Net Frameworks 4.0 is installed on the computer.

           SandBox-Bin.zip

 

Source of Course (24 KB):

This Zip file contains Visual Basic 2010 source project. It does require the Scintilla.dll, ScintillaNet.dll. I recommend that you download the latest version form their home pages (see the PDF document). Alternatively you can use the ones form the BIN file above.

           Sandbox-proj.zip

 

 

Web Links :

 SQLIte: SQLite Home Page

System.Data.SQLite: SQLite ADO.Net home page

SQLite ODBC: SQLite ODBC drive page

Sqliteman: SQLite Database manager (open source, multi-platform). Portable Windows version available

Wikipedia: Wikipedia article on SQLite

FreeBasic: FreeBasic Home page

Scintilla: Scintilla Home page

ScintillaNet: ScintillaNet Home Page

 

Shameless Self Promotion:

KeyWild Arduino: My Arduino projects (ATMEL ATMega based Nano Digital Thermometer)

KeyWild CAD Library: A Public Domain Library of DWG files for use with CAD systems (Fasteners, World Map, etc.)

Back Office, Six Mountains: A novel that I wrote (published on Amazon Kindle)

 

 

 

 

 

 

 

 

 

 

 

Keywild.com home page