I’m trying to load data into a table from a sqlite table using the following:
local myData = {} local int = 1 --Go through my database selecting all the subcategory name local dbPath = system.pathForFile("EMS\_DB.sqlite", system.DocumentsDirectory) local db = sqlite3.open( dbPath) for row in db:nrows("SELECT \* FROM Pro\_SubCategory") do myData[int].name = row.Sub\_Cat\_Name myData[int].phone = row.Sub\_CatID int = int+1 end db:close()
When I try to run it, I get the following error from the simulator:
No such table Pro_SubCategory
The table does exist in the database and the database is in the project, so I’m not sure if there’s something else I’m missing. Does the database need to be somewhere specific?