The_killer01
New Member
Hello, Friends!
As I am new to B4A and I am just a student, I am working on an app/game that needs to connect to a database. In this case, I am currently using DB Browser for SQLite.
I created a table named "Questions" in DB Browser and has some attributes in it.
But when I try to insert data into it from my app in B4A, the B4A throws an exception that it can't find the table when in fact it is there.
My ExecNonQuery format is correct as I've tried it on DB Browser.
If you can help me, this will be a huge win for me. I've tried many different solutions but none of them are working.
I guess this is my last resort.
Thank you!
As I am new to B4A and I am just a student, I am working on an app/game that needs to connect to a database. In this case, I am currently using DB Browser for SQLite.
I created a table named "Questions" in DB Browser and has some attributes in it.
But when I try to insert data into it from my app in B4A, the B4A throws an exception that it can't find the table when in fact it is there.
My ExecNonQuery format is correct as I've tried it on DB Browser.
If you can help me, this will be a huge win for me. I've tried many different solutions but none of them are working.
I guess this is my last resort.
Thank you!
Error Message:
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (category) Create (first time) **
** Activity (category) Resume **
** Activity (category) Pause, UserClosed = true **
** Activity (technology) Create (first time) **
** Activity (technology) Resume **
** Activity (technology) Pause, UserClosed = true **
** Activity (tech_1) Create (first time) **
** Activity (tech_1) Resume **
Error occurred on line: 329 (Tech_1)
android.database.sqlite.SQLiteException: no such table: Questions (code 1): , while compiling: INSERT INTO Questions (ID,category,question_number,score,complete) VALUES (1, 'Technology', 1, 100, '1')
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1677)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1608)
at anywheresoftware.b4a.sql.SQL.ExecNonQuery(SQL.java:74)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.example.tech_1._insertdata(tech_1.java:981)
at b4a.example.tech_1._btn_submit_click(tech_1.java:877)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5638)
at android.view.View$PerformClick.run(View.java:22430)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
** Activity (tech_1) Pause, UserClosed = true **