I was attempting to view the contents of what I thought was a SQLite3 database file so I needed a GUI of some sort to do so. Anyhow first I decided to install SQLite. Once I did this and created a test database to make sure to SQLite GUI was working I finally decided the file I was trying to open was not a SQLite3 database file.
- Download SQLite: First visit this page to download SQLite. The Windows precompiled binaries are located near the bottom of the page.
- Unpack SQLite: In my case the latest version of SQLite was 3.6.14 so the downloaded file was named sqlite-3_6_14.zip. Right click this file and choose to uncompress in the same directory. This will produce a sqlite3.exe file.
- Install SQLite: Now double click on the sqlite.exe file to install SQLite.
- Test SQLite:To test SQLite open up a command prompt window and type “sqlite3″. To get some help with SQLite type “.help” and to close sqlite3 type “.quit” .
Create a Test SQLite Database:
- Create SQLite Test Database: Issue the below command from a Windows Command Prompt window from the folder where you extracted the sqlite3.exe to create a test SQLite database.
The below example image shows the command to issue from a Windows Command Prompt to launch a sqlite3 shell while generating a sqlite3 database at the same time.
Launch SQLite3 Shell From Windows Command Prompt:
Remember to exit out of the sqlite3 command prompt type the below.
- Create a SQLite Table: Issue the below command to create a table in the test database.
sqlite3 sqlite.db "create table tb1 (tb1key INTEGER PRIMARY KEY,data TEXT,num double,timeEnter DATE);"
- Add Data Into Test Database: Now issue each of the three commands below to insert data into the test database table we created.
sqlite3 sqlite.db "insert into tb1 (data,num) values ('Test data',9);" sqlite3 sqlite.db "insert into tb1 (data,num) values ('More test data',8);" sqlite3 sqlite.db "insert into tb1 (data,num) values ('Third set of data',7);"
- View Test SQLite Data:Now list all of the rows in the test table located in the test sqlite database.
sqlite3 sqlite.db "select * from tb1";
Install SQLite GUI for Windows:
- Download SQLite GUI SQTView:Visit download.com to download the latest version of SQTView located here.
- Install SQTView:The downloaded file will be named inSQTV.exe. Double click this file to install SQTView.
- Test SQTView:Once installed locate the application in the Start Menu under Program Files in the APSoft folder. Now locate the testdb.db file you created with the sqlite3 CLI commands. Open this file to verify everything is functioning properly. You will not be able to edit the database with SQTView. This application is only for viewing SQLite2 and SQLite3 database files.
The above will allow you to create a sqlite3 database and view the database with the SQTView GUI for Windows.