Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    5,380

    Create batabase tables on the fly

    Hi Guys, just a general sqlite question

    i am wondering if its possable to let my users create tables (categories) on a single database,

    like do all tables have to be created at the same time or can i add tables as and when i want to, and the same for deleteing them

    or will i have to make a new database for each new categorie i want to add
    Open your eyes to Narcissism, Don't let her destroy your life!!

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    ok, trial and error, it works, so i can create tables on the fly

    but i have a new question, i need a way to get the database tablenames into a listbox, i have searched the sqlite help file but cant seem to find a answer, everything seems to point towards column names
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Mar 2005
    Posts
    187
    Hi RizlaUK,

    Try this, from http://www.sqlite.org/faq.html#q9:

    (9) How do I list all tables/indices contained in an SQLite database?

    ...

    Every SQLite database has an SQLITE_MASTER table that defines the schema for the database. The SQLITE_MASTER table looks like this:

    CREATE TABLE sqlite_master (
    type TEXT,
    name TEXT,
    tbl_name TEXT,
    rootpage INTEGER,
    sql TEXT
    );

    For tables, the type field will always be 'table' and the name field will be the name of the table. So to get a list of all tables in the database, use the following SELECT command:

    Code:
    SELECT name FROM sqlite_master
    WHERE type='table'
    ORDER BY name;

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    Hey Thanks, this seems pertty easy now
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Using a for loop to create multiple tables
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 04-20-2004, 07:30 AM
  2. Always confusing with tables
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-25-2004, 06:33 PM
  3. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  4. HOWTO: Create a Page Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-26-2002, 05:20 AM
  5. HOWTO: Create Nested Shortcuts in the Start Menu
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-24-2002, 10:26 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