Android Question SQLite

Discussion in 'Android Questions' started by Pilar-JLSineriz, Jun 9, 2015.

  1. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Hello... I have a SQlite database, and I view the tables content from different activities.. Now, I have an error "android.database.sqlite.SQLite exception; no such table!

    I can´t understand, because the table is in the database, I suppose that the application is using a BD that it is not the last version. how I can test which BD is using my application?

    Best regards and thanks
     
  2. inakigarm

    inakigarm Well-Known Member Licensed User

    Maybe a coding query error ?? Take the SQL Query you're coding in B4A and test it with an external SQLite Browser program with your DB
     
  3. klaus

    klaus Expert Licensed User

    Without knowing what exactly you have done it's almost impossible to give a concrete advice.
    How and where do you declare the SQLite object ?
    Where do you save the database ?
    Are you sure that the database is in the folder where you declare it to be ?
    etc...
     
  4. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Dear Klaus,
    I declare the SQlite object following the instructions User's guide (4.1 SQlite Database basics).
     
  5. klaus

    klaus Expert Licensed User

    You have not answered the two other questions.
    Otherwise post your project as a zip file so we could see what exactly you have done.
     
  6. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Ok Klaus.. I've solved the problem, thanks!
     
  7. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Hello, again, Klaus, now I have other problem, in a first time, the BD name was "pasivosmineros.sqlite". Now, I rename to "PasivosMineros.sqlite". If I execute the application in debbug mode, I don´t have problem, but I execute in release mode, I have an error "java.io.filenotfoundexception:"pasivosmineros.sqlite", how I can solve it? Thanks again

    Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
    File.Delete(File.DirInternal, "PasivosMineros.sqlite") ' only for testing, removes the database

    If File.Exists(File.DirInternal, "PasivosMineros.sqlite") = False Then

    File.Copy(File.DirAssets, "PasivosMineros.sqlite", File.DirInternal, "PasivosMineros.sqlite")

    s.Initialize(File.DirInternal, "PasivosMineros.sqlite", True)
    File.Copy(File.DirAssets, "PasivosMineros.sqlite", File.DirInternal, "PasivosMineros.sqlite")
    Else
    s.Initialize(File.DirInternal, "PasivosMineros.sqlite", True)
    End If

    End If

    Activity.LoadLayout("screen1_pasivominero")
    Activity.title="Inventario de Pasivos Mineros"

    End Sub
     
  8. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Hi Klaus, I solved the problem in build configurations using different name for the package.. I don´t know if it is the best solution but it works
     
  9. klaus

    klaus Expert Licensed User

    You probably should have deleted the 'old' program from the device.
    To be sure that DirInternal was really cleared.
     
  10. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    THANKS THANKS THANKS!!!!!!!!!!!!
     
Loading...