MarcioCC Member Licensed User Longtime User Jan 22, 2016 #1 good night, insert a picture in my database SQLite now want to read the image, more ta giving the following error when I run the app: android.database.sqlite.SQLiteException: no such column: name (code 1):, while compiling: SELECT * FROM WHERE name = TBFILMES? The error is giving this line: Cursor1 = s.ExecQuery2 ("SELECT PHOTO FROM TBFILMES WHERE name =?" Array As String ("")) What am I doing wrong??
good night, insert a picture in my database SQLite now want to read the image, more ta giving the following error when I run the app: android.database.sqlite.SQLiteException: no such column: name (code 1):, while compiling: SELECT * FROM WHERE name = TBFILMES? The error is giving this line: Cursor1 = s.ExecQuery2 ("SELECT PHOTO FROM TBFILMES WHERE name =?" Array As String ("")) What am I doing wrong??
LucaMs Expert Licensed User Longtime User Jan 22, 2016 #2 MarcioCC said: no such column: name Click to expand... TBFILMES has not a column named "name" (in your post a comma misses before Array As String) Upvote 0
MarcioCC said: no such column: name Click to expand... TBFILMES has not a column named "name" (in your post a comma misses before Array As String)
MarcioCC Member Licensed User Longtime User Jan 22, 2016 #3 hit the column more now ta giving this error: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 Upvote 0
hit the column more now ta giving this error: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
MarcioCC Member Licensed User Longtime User Jan 22, 2016 #4 the mistake is giving this line: Buffer = Cursor1.GetBlob("FOTO") Upvote 0
LucaMs Expert Licensed User Longtime User Jan 22, 2016 #5 Check Cursor1.RowCount and set cursor position Upvote 0
mangojack Expert Licensed User Longtime User Jan 23, 2016 #8 The error is giving this line: Cursor1 = s.ExecQuery2 ("SELECT PHOTO FROM TBFILMES WHERE name =?" Array As String ("")) Click to expand... Code: Copy Cursor1 = SQL1.ExecQuery2("SELECT FOTO FROM TBFILMES WHERE name = ?", Array As String("TheImageNameYouWantToGet")) as @LucaMs suggested .. after your query check cursor rowcount .. Code: Copy Log(Cursor1.RowCount) Cursor1.Position = 0 Dim Buffer() As Byte 'declare an empty byte array Buffer = Cursor1.GetBlob("FOTO") It might be better if you post the full sub for a clearer look at your code .. Upvote 0
The error is giving this line: Cursor1 = s.ExecQuery2 ("SELECT PHOTO FROM TBFILMES WHERE name =?" Array As String ("")) Click to expand... Code: Copy Cursor1 = SQL1.ExecQuery2("SELECT FOTO FROM TBFILMES WHERE name = ?", Array As String("TheImageNameYouWantToGet")) as @LucaMs suggested .. after your query check cursor rowcount .. Code: Copy Log(Cursor1.RowCount) Cursor1.Position = 0 Dim Buffer() As Byte 'declare an empty byte array Buffer = Cursor1.GetBlob("FOTO") It might be better if you post the full sub for a clearer look at your code ..
MarcioCC Member Licensed User Longtime User Jan 23, 2016 #10 taking advantage of the post know why is giving this error ?? Error occurred on line: 82 (DBUtils) java.lang.RuntimeException: Object should first be initialized. line that is giving the error: SQL.BeginTransaction Upvote 0
taking advantage of the post know why is giving this error ?? Error occurred on line: 82 (DBUtils) java.lang.RuntimeException: Object should first be initialized. line that is giving the error: SQL.BeginTransaction
LucaMs Expert Licensed User Longtime User Jan 23, 2016 #11 MarcioCC said: Object should first be initialized Click to expand... Read the error message: SQL is not initialized Upvote 0
MarcioCC said: Object should first be initialized Click to expand... Read the error message: SQL is not initialized
MarcioCC Member Licensed User Longtime User Jan 23, 2016 #12 how do I start SQL ?? It has an example Upvote 0
imbault Well-Known Member Licensed User Longtime User Jan 23, 2016 #13 MarcioCC said: how do I start SQL ?? It has an example Click to expand... Yes a lot Code: Copy Dim SQL1 As SQL SQL1.Initialize(File.DirDefaultExternal, "smile.db", False) Upvote 0
MarcioCC said: how do I start SQL ?? It has an example Click to expand... Yes a lot Code: Copy Dim SQL1 As SQL SQL1.Initialize(File.DirDefaultExternal, "smile.db", False)