New topic: 

Adding tables and fields to existing database

<http://forums.realsoftware.com/viewtopic.php?t=29729>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       martinpaulrice           Post subject: Adding tables and fields 
to existing databasePosted: Tue Aug 25, 2009 1:02 pm                        
Joined: Wed Apr 11, 2007 1:17 pm
Posts: 37              In the app I'm working on, I create the database with 
code (which I believe I got from the Database Example project) and it works 
just fine. The code is in the app.open event and looks like this:

  Code:// Create the Database file
If BudgetDB.CreateDatabaseFile = False then
  // Error While Creating the Database
  MsgBox "Database Error" + EndOfLine + EndOfLine +_
  "There was an error when creating the database."
  Quit
End if

//Create the tables for the database
BudgetDB.SQLExecute "create table Accounts (AcctID Integer NOT NULL PRIMARY 
KEY, AcctMonth varchar, AcctType varchar," +_
  "AcctName varchar, AcctBal Currency)"

BudgetDB.SQLExecute "create table Budget (BudID Integer NOT NULL PRIMARY KEY, 
BudAcctType varchar," +_
  "BudAcctName varchar, BudAcctBal Currency)"

BudgetDB.SQLExecute "create table Transactions (TransID Integer NOT NULL 
PRIMARY KEY, TransDate Date," +_
  "TransDesc varchar, TransCheck varchar, TransMemo varchar, TransAmt 
Currency," +_
  "TransFrom varchar, TransTo varchar)"


What I'm wondering is whether I can add another table to this db without 
deleting it and starting over? Also, can I add other fields to tables already 
created without deleting and starting over?

Thanks.     
_________________
Martin
Signal Mountain, TN  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
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

[email protected]

Reply via email to