New topic: Couple of SQLite problems
<http://forums.realsoftware.com/viewtopic.php?t=46782> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message van_xan Post subject: Couple of SQLite problemsPosted: Fri Feb 01, 2013 4:47 pm Joined: Sun Oct 21, 2012 11:59 pm Posts: 7 Alrighty so I'm building an admin window into my time clock program to view the database, create new users(tables), add up the times in the columns and then email the total off. Right now I'm gonna take it a step at a time to explain my problem. So for the first part, I want to be able to create a new user(table) by just clicking a button and naming it whatever was imputed into the edit field next to it. This is my code for it; TimeClock.SQLExecute("Create Table User_" + NewUserFld.Text"(Clock_In TEXT)") Now obviously this wont work and I'm trying to figure out what would be the correct code for going about this, but still getting the same result. I thought about when clicking the button it would just create a new table named "NEW" with all the correct columns, then renaming itself to the right name, but my coding knowledge is kinda limited. Any help would be greatly appreciated and I will post about the other problems after this one is solved. Top timhare Post subject: Re: Couple of SQLite problemsPosted: Fri Feb 01, 2013 5:12 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12043 Location: Portland, OR USA That looks like ok syntax. Are you getting an error of some kind? Make sure you commit after you create the table. Top van_xan Post subject: Re: Couple of SQLite problemsPosted: Fri Feb 01, 2013 5:26 pm Joined: Sun Oct 21, 2012 11:59 pm Posts: 7 timhare wrote:That looks like ok syntax. Are you getting an error of some kind? Make sure you commit after you create the table. Haha I figured it out, I forgot to add the "+" before the column creation part. ---------- Onto the second question. How would I load the names of the tables into a combobox? Top timhare Post subject: Re: Couple of SQLite problemsPosted: Fri Feb 01, 2013 6:22 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12043 Location: Portland, OR USA Use TableSchema. There's an example in the LR that loads the names into an array. Modify it to add the names to the ComboBox. http://docs.realsoftware.com/index.php/Database.TableSchema Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml rbforumnotifier@monkeybreadsoftware.de