I want to connect to a local database with Mathematica. I used DB Browser for SQLite to create the database with a single table and then exported it locally as a .sql file. To access the database I tried the following lines:
Needs["DatabaseLink`"]; OpenSQLConnection[JDBC["SQLite"]] db = Database`OpenDatabase["C:\\db\\testDB.sql"]; results = Database`QueryDatabase[db, "SELECT * FROM `Table1`"]
The following error is output:
Database`QueryDatabase::stmt: The statement "SELECT * FROM `Table1`" is invalid: "file is encrypted or is not a database".
The testDB.sql file looks like this:
BEGIN TRANSACTION; CREATE TABLE "Table1" ( `field1` TEXT, `field2` TEXT, ); INSERT INTO `Table1` VALUES ('point1','point2'); INSERT INTO `Table1` VALUES ('dot1','dot2'); COMMIT;
Any help will be greatly appreciated. Thx.