Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:48:18+00:00 2026-06-11T22:48:18+00:00

When i compile the app these errors show: sqlite returned: error code = 1,

  • 0

When i compile the app these errors show:

   sqlite returned: error code = 1, msg = table mensagens already exists
   Failure 1 (table mensagens already exists) on 0x240328 when preparing 'create table mensagens(mensagemsalva varchar(250),mensagemenviada varchar(250))'.
   sqlite returned: error code = 1, msg = table contatos already exists
   Failure 1 (table contatos already exists) on 0x240328 when preparing 'create table contatos(nome varchar(50),telefone varchar(20))'.

My Main.java has this code which is meant to create the database and its tables:

  onCreate(..){
   ...
  db = openOrCreateDatabase("banco.db", Context.MODE_WORLD_WRITEABLE, null);
    ...
    VerificaDados();
  }

    private void VerificaDados() {
    // TODO Auto-generated method stub

    try {
        //cria uma TABLE de nome MENSAGENS
        db.execSQL("create table mensagens(mensagemsalva varchar(250),mensagemenviada varchar(250))");
        //ShowMessage("Banco","Criou a tabela de mensagens");
    }
    catch (Exception e) {

        }
    try{
        //cria uma TABLE de nome CONTATOS
        db.execSQL("create table contatos(nome varchar(50),telefone varchar(20))");
        //ShowMessage("Banco","Criou a tabela de contatos");
    }catch (Exception a){

    }

}

idk what it can be because i just run the app and BAM, errors in LogCat.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:48:19+00:00Added an answer on June 11, 2026 at 10:48 pm

    Have a look athe the SQLiteOpenHelper API Docs.

    this class takes care of opening the database if it exists, creating
    it if it does not, and upgrading it as necessary.

    You should try to distinguish between onCreate() and onUpdate().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having this errors when trying to compile/run my app using Maven. I've succeeded to
I'm trying to compile a hello-world app: 8g test1.go -o test1.8 Error: open -o:
When I try to compile to following code, I get two errors: Description Resource
I'm using xcodebuild to compile my iPhone app from the command line. Is there
when i want compile my app with the Distribution or Release method i get
I have had to compile my app for the 4.0 sdk to run on
I've been trying to compile an iPhone app to test on a device, it's
I am building an iPad app using Flash CS6 to compile to AIR 3.3
When I want to compile a released version of my app, I sign it
We are writing an app that will use T4 to generate Flex/Actionscript to compile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.