Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Location
    Denmark
    Posts
    336

    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

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    "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

  3. #3
    Join Date
    Jul 2004
    Location
    Denmark
    Posts
    336
    Quote 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

Similar Threads

  1. SQLite plugin problem
    By swilk in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 11-10-2009, 05:22 PM
  2. SQLite database in MEMORY only!
    By Intrigued in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 10-23-2009, 07:49 PM
  3. SQLite Listing problem
    By Beningram in forum AutoPlay Media Studio 5.0
    Replies: 16
    Last Post: 12-10-2005, 10:44 AM
  4. Spotlight: SQLite Actions Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-12-2004, 09:11 AM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts