D dougc Member Licensed User Longtime User Mar 9, 2013 #1 i have a DB called (bowling.sqlite) with a table called games that everytime dbutils tries to write to it I get the error: InsertMaps (first query out of 1): INSERT INTO [games] ([date], [score]) VALUES (?, ?) (SQLiteException) android.database.sqlite.SQLiteException: no such table: games (code 1): , while compiling: INSERT INTO [games] ([date], [score]) VALUES (?, ?) Click to expand... the code is: Code: Copy Dim ListOfMaps As List ListOfMaps.Initialize Dim m As Map m.Initialize 'm.Put("Id", Id) m.Put("date", DateTime.Date(DateTime.Now)) m.Put("score", Main.totalScore) ListOfMaps.Add(m) DBUtils.InsertMaps(SQL, "games", ListOfMaps) here is the code to copy the DB to my phone Code: Copy If File.Exists(File.DirDefaultExternal, DBFileName) = False Then DBFileDir = DBUtils.CopyDBFromAssets(DBFileName) Log("copied DB to device ....") End If and here is my process_globals section Code: Copy Dim SQL As SQL Dim DBFileName As String : DBFileName = "bowling.sqlite" Dim DBFileDir As String : DBFileDir = File.DirDefaultExternal i have tried doing an insert to the DB using firefox's sqlite plugin (which works just fine). Verified that the DB is on my phone (/storage/sdcard/Android/data/bagofchipapps.com.bowlingLogger/files) and I installed a sqlite DB viewer and looked at the database ON my phone and see the games table just fine. I am using dbutils versions 1.09, I am sure I am missing something but its escaping me, any suggestions/advice is appriciated thanks dougc
i have a DB called (bowling.sqlite) with a table called games that everytime dbutils tries to write to it I get the error: InsertMaps (first query out of 1): INSERT INTO [games] ([date], [score]) VALUES (?, ?) (SQLiteException) android.database.sqlite.SQLiteException: no such table: games (code 1): , while compiling: INSERT INTO [games] ([date], [score]) VALUES (?, ?) Click to expand... the code is: Code: Copy Dim ListOfMaps As List ListOfMaps.Initialize Dim m As Map m.Initialize 'm.Put("Id", Id) m.Put("date", DateTime.Date(DateTime.Now)) m.Put("score", Main.totalScore) ListOfMaps.Add(m) DBUtils.InsertMaps(SQL, "games", ListOfMaps) here is the code to copy the DB to my phone Code: Copy If File.Exists(File.DirDefaultExternal, DBFileName) = False Then DBFileDir = DBUtils.CopyDBFromAssets(DBFileName) Log("copied DB to device ....") End If and here is my process_globals section Code: Copy Dim SQL As SQL Dim DBFileName As String : DBFileName = "bowling.sqlite" Dim DBFileDir As String : DBFileDir = File.DirDefaultExternal i have tried doing an insert to the DB using firefox's sqlite plugin (which works just fine). Verified that the DB is on my phone (/storage/sdcard/Android/data/bagofchipapps.com.bowlingLogger/files) and I installed a sqlite DB viewer and looked at the database ON my phone and see the games table just fine. I am using dbutils versions 1.09, I am sure I am missing something but its escaping me, any suggestions/advice is appriciated thanks dougc
mc73 Well-Known Member Licensed User Longtime User Mar 9, 2013 #2 Can you please post the sql initialization statement too? Upvote 0
D dougc Member Licensed User Longtime User Mar 9, 2013 #3 sorry I missed that line when copying Code: Copy SQL.Initialize(File.DirRootExternal, "bowling.sqlite", True) Upvote 0
sorry I missed that line when copying Code: Copy SQL.Initialize(File.DirRootExternal, "bowling.sqlite", True)
mc73 Well-Known Member Licensed User Longtime User Mar 9, 2013 #4 In your previous code you are using dirDefaultExternal, thus this line should be: Code: Copy SQL.Initialize(File.DirDefaultExternal, "bowling.sqlite", True) Upvote 0
In your previous code you are using dirDefaultExternal, thus this line should be: Code: Copy SQL.Initialize(File.DirDefaultExternal, "bowling.sqlite", True)
D dougc Member Licensed User Longtime User Mar 9, 2013 #5 that was my issue, thank you very much dougc Upvote 0