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 8872115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:08:52+00:00 2026-06-14T18:08:52+00:00

Please why do I get the error SQLiteException: no such table: tabella (code1)??? from

  • 0

Please why do I get the error “SQLiteException: no such table: tabella (code1)???

from LogCat I get: “SQLiteException: no such table: tabella (code1)” when I try to access the database fro the activity.

Here is the SQLiteOpenHelper code:

public class DatabaseHelper extends SQLiteOpenHelper {
    private static final String CREATE_DB_SQL = "CREATE TABLE tabella (_id INTEGER     PRIMARY KEY AUTOINCREMENT, colonna1 TEXT, colonna2 TEXT, colonna3 TEXT);";
    public DatabaseHelper(Context context) {
    super(context, "basedati", null, 1);
    }

    @Override
public void onCreate(SQLiteDatabase db) {

        db.execSQL(CREATE_DB_SQL);
        ContentValues cv = new ContentValues (3);
        cv.put("colonna1", "valore colonna 1");
        cv.put("colonna2", "valore colonna 3");
        cv.put("colonna3", "valore colonna 3");
        db.insert("tabella", "colonna1", cv);
}

@Override
    public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {
        db.execSQL("DROP TABLE IF EXISTS tabella");
        onCreate(db);   
    }
}

Here is the Activity code in which I try to open the database:

public class MainActivity extends Activity {
    private DatabaseHelper db=null;
    private Cursor constantsCursor=null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        db = new DatabaseHelper(this);

        constantsCursor=db.getReadableDatabase().rawQuery("SELECT colonna1 FROM  tabella ORDER BY colonna1", null);
        }
}
  • 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-14T18:08:53+00:00Added an answer on June 14, 2026 at 6:08 pm

    Odds are that you have changed the table after running your app at least once. You cannot simply change the Java String CREATE_DB_SQL, you must also update the SQL schema. The easiest way to do this is to increment the version number:

    public DatabaseHelper(Context context) {
        super(context, "basedati", null, 2); // Change the number to two 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following PHP code for trigger creation but always get error, please
I get this error when trying ruby script/console Rails requires RubyGems >= . Please
Please help with the following error that I get with Spring Security 3.05 and
i'm using QT Creator 1.3.1 and trying to compile, but get this error... please
This coding i got from here. I get error in log cat view like
please can anyone tell me the error ! i get error in the line
When I try to start MySQL I get: ERROR 2002 (HY000): Can't connect to
I'm trying to get information from mysql database using GET id. I use the
In some way I have managed to get this error when I try to
Please refer to Get PDF hyperlinks on iOS with Quartz It explained an algorithm

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.