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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:50:03+00:00 2026-06-01T16:50:03+00:00

I have a database which already contains a table LocalLogin and is properly set

  • 0

I have a database which already contains a table “LocalLogin” and is properly set and can be queried without a problem, being set up the same way as my new table “PersonList”. However when I try to execute a query on PersonList to select some values, I get the error

android.database.sqlite.SQLiteException: no such table: PersonList: , while compiling: SELECT ...

It gives me the idea that the table was never created, although I execute a create query in the onCreate method of my SQLiteOpenHelper class. Is having the same Database Name as LocalLogin the possible problem?

Here’s the relevant code:

The Database Adapter class

public class GoingOutPersonListDbAdapter {
private static final String DATABASE_NAME = "GoingOutData";
private static final String DATABASE_TABLE_PERSONLIST = "PersonList";
private static final int DATABASE_VERSION = 1;

public static final String PERSONLIST_ID = "PersonList_id";
public static final String PERSONLIST_LOGIN = "Login";
public static final String PERSONLIST_PASSWORD = "Password";

private static final String TAG = "Debugstring";

private PersonListDatabaseHelper mPersonListDbHelper;
private SQLiteDatabase mDb;

private static final String DATABASE_CREATE = 
    "CREATE Table " + DATABASE_TABLE_PERSONLIST+ " ( "
    + PERSONLIST_ID + " integer PRIMARY KEY Autoincrement, "
    + PERSONLIST_LOGIN + " text NOT NULL,"
    + PERSONLIST_PASSWORD + " text NOT NULL );";

private final Context mCtx;

private static class PersonListDatabaseHelper extends SQLiteOpenHelper {
    PersonListDatabaseHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.d(TAG,DATABASE_CREATE);
        db.execSQL(DATABASE_CREATE);
    }
}

public GoingOutPersonListDbAdapter(Context ctx) {
    this.mCtx = ctx;
}

public GoingOutPersonListDbAdapter open() throws SQLException {
    mPersonListDbHelper = new PersonListDatabaseHelper(mCtx);
    mDb = mPersonListDbHelper.getWritableDatabase();
    return this;
}

public Cursor searchPerson(String searchString) {
    return mDb.query(DATABASE_TABLE_PERSONLIST, new String[] {PERSONLIST_ID, PERSONLIST_LOGIN, PERSONLIST_PASSWORD}, searchString, null, null, null, null);
}

}

In my activity class:

private GoingOutPersonListDbAdapter mPersonListDbHelper;

...

mPersonListDbHelper = new GoingOutPersonListDbAdapter(this);
mPersonListDbHelper.open();

...

//loginEditText is properly set
Cursor personList = mPersonListDbHelper.searchPerson(GoingOutPersonListDbAdapter.PERSONLIST_LOGIN + " = '" + loginEditText + "'");
startManagingCursor(personList);
  • 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-01T16:50:05+00:00Added an answer on June 1, 2026 at 4:50 pm

    If you’re adding a new table, you need to increment your database version so onUpdate will fire and your database will be recreated with the new table.

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

Sidebar

Related Questions

I have a MySQL database which contains a table of users. The primary key
Greetings, stack overflow In my database, I already have one table, 'contacts' that contains
I have an (access) database table which contains data I would like to populate
I have a database which is in Access (you can get it link text
I have a database which contains picture data stored as a binary blob. The
At the moment, I have a database which contains username, password, etc. I am
Currently we have a table with a bunch of data from a database which
I have a table of Users (tblUsers) which contains details of University staff. I
I have a table that contains information on groups. There can be any number
I have a database table transaction which stores all the transaction made by users

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.