logo       

[android-beginners] Database Issues...: msg#01187

AndroidBeginners

Subject: [android-beginners] Database Issues...


Hi there

I am trying to create a database with two tables. Employees and
Computers. A spinner with employee names fill properly when I don't
try create and do anything with the second table... The code to create
is:

private static class DBOpenHelper extends SQLiteOpenHelper {
private static final String CREATE_TABLE_USERS = "create table
" +
TABLE_USERS + " (" + USER_KEY_ID +
" integer primary key autoincrement, " +
USER_KEY_USER + " text not null, " +
USER_KEY_PIN + " string);";
private static final String CREATE_TABLE_ACCOUNTS = "create
table "
+
TABLE_COMPUTERS + " (" + ACC_KEY_ID +
" integer primary key autoincrement, " +
ACC_KEY_USERID + " integer not null, " +
ACC_KEY_COMP_SERIAL + " text not null);";

public DBOpenHelper(Context context, String name,
CursorFactory factory, int version) {
super(context, name, factory, version);
}

@Override
public void onCreate(SQLiteDatabase _db) {
_db.execSQL(CREATE_TABLE_USERS);
_db.execSQL(CREATE_TABLE_COMPUTERS);
}

Is there somehting I am doing wrong during the creating, as the rest
of the code (to read data) is exactly the same... but I can't figure
it out.

Please help!!!

Thanks in advance,
Neil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-beginners-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise