- Make sure you have the latest version of SQLite
- Make sure you have the latest version of Mingw
- Using your favourite text editor, create a file called test.c and save it somwhere you can compile it. Make sure the sqlite.dll file is in the same directory. Here is the code for test.c:
- Compile test.c with the following: gcc -o main.exe -I /include sqlite.dll sltest2.c
- In the same directory as the compiled c file, enter: "sqlite test.db". This will create a new database named "test.db". Of course, sqlite.exe must either be in this directory or in your path.
- Enter the following:
sqlite> CREATE TABLE Orders ...> ( ...> Orders ...> );
- And the following:
sqlite> INSERT INTO orders VALUES ("Order1"); sqlite> INSERT INTO orders VALUES ("Order2");
- And then:
- Type the following command: main test.db "SELECT * FROM Orders;". If you are using a different db, modify the SQL statement accordingly.
- You should see:
C:\EJD\MinGW\bin>main test.db "SELECT * FROM Orders;". Orders = Order1 Orders = Order2