Create statement not executed

Put your problem here if it does not fit any of the other categories.

Create statement not executed

Postby MobileBen » Thu Mar 20, 2008 6:56 pm

Hello,

I tried the code example from this post.

http://www.anddev.org/working_with_the_ ... -t319.html

The database will be created perfectly but the Table isn't. It seems to me that the cde will not be executed but I don't know why. When I try this Create statement in the sqlite3 console it works.

Can anybody help me

This is the code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. SQLiteDatabase myDB = null;
  2.  
  3.        
  4.  
  5.  try {
  6.  
  7.               /* Create the Database (no Errors if it already exists) */
  8.  
  9.               this.createDatabase(MY_DATABASE_NAME, 1, MODE_PRIVATE, null);
  10.  
  11.              
  12.  
  13.               /* Open the DB and remember it */
  14.  
  15.               myDB = this.openDatabase(MY_DATABASE_NAME, null);
  16.  
  17.              
  18.  
  19.               /* Create a Table in the Database. */
  20.  
  21.               myDB.execSQL("CREATE TABLE IF NOT EXISTS "
  22.  
  23.                                   + MY_DATABASE_TABLE
  24.  
  25.                                   + " (Name VARCHAR, bTime INT(2));");
  26.  
  27.               ....
Parsed in 0.032 seconds, using GeSHi 1.0.8.4



Thx
MobileBen
Freshman
Freshman
 
Posts: 4
Joined: Thu Mar 20, 2008 4:10 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 21 guests