problem with SQLite

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Jonas DK
    Indigo Rose Customer
    • Jul 2004
    • 345

    problem with SQLite

    Hi I keep getting an SQL error and I can't figure out what the problem is.

    I tried deleting the query and copying one I know work but I still get the error.

    The application last error is:
    Code:
    [47]: SQLite.Query(db, "CREATE TABLE tPostnrBy(ID integer primary key, Postnr text, By text)", nil);
    TRACE: LastError = 30001 ("SQL logic error or missing database")
    All the other tables are created with out problems.

    The code I used is this:
    Code:
    db = SQLite.Open(Shell.GetFolder(SHF_MYDOCUMENTS).."\\ScRun.dat");
    
    SQLite.Query(db, "CREATE TABLE tMedlem(ID integer primary key, CPR text, Fornavn text, Efternavn text, Adresse text, Postnr text, Enhed text)", nil);
    			SQLite.Query(db, "CREATE TABLE tData(ID integer primary key, CPR text, Parent text, Tel1 integer, Tel2 integer, Tel3 integer, Email text, Car text, Foto text, Notat text, Indmeldt, Udmeldt)", nil);
    			SQLite.Query(db, "CREATE TABLE tBetaling(ID integer primary key, CPR text, Betaling text)", nil);
    			SQLite.Query(db, "CREATE TABLE tPostnrBy(ID integer primary key, Postnr text, By text)", nil);
    			SQLite.Query(db, "CREATE TABLE tEnhed(ID integer primary key, Navn text)", nil);
    			SQLite.Query(db, "CREATE TABLE tFoto(ID integer primary key, Navn text)", nil);
    			SQLite.Query(db, "CREATE TABLE tCar(ID integer primary key, Navn text)", nil);
    Can someone see what the problem is?

    Cheers,
    Jonas
  • Dermot
    Indigo Rose Customer
    • Apr 2004
    • 1791

    #2
    "By" is a reserved word in SQLite. http://www.sqlite.org/lang_keywords.html

    Try naming that field something else.
    Dermot

    I am so out of here :yes

    Comment

    • Jonas DK
      Indigo Rose Customer
      • Jul 2004
      • 345

      #3
      Originally posted by Dermot View Post
      "By" is a reserved word in SQLite. http://www.sqlite.org/lang_keywords.html

      Try naming that field something else.
      Of couse it is.

      Thats the problem with not working in the native language of english.

      I'll just replace By with City as that is what it means in danish.

      Cheers and thanks for the quick help.


      Jonas

      Comment

      Working...
      X