New topic: 

trying to create realSQLdatabase incode

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        coryhefner          Post subject: trying to create 
realSQLdatabase incodePosted: Fri Nov 26, 2010 11:18 pm                         
Joined: Thu Dec 10, 2009 2:00 pm
Posts: 57
Location: Calafornia                I have read and followed the examples in 
the user manual and the orders db example, and also viewed various post.  
I am trying to figure out 
1) if the IDE only creates temp database from code 
2) if not then what am I doing wrong with the following code. I have verfied 
that the database gets created temporarly but is deleted after I exit the IDE. 

  // Create the database file
  if DojoStudioDB.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 physical database
  DojoStudioDB.SQLExecute ("create database DojoStudioDB") 
  
  // Create the tables for the database
  
  //Customer Table
  DojoStudioDB.SQLExecute "create table t_cust (acntnum varchar, locnum 
varchar, lastName varchar, firstname varchar, address varchar, city varchar, "+_
  "state varchar, zipcode varchar,  Email varchar, phone1 varchar, phone2 
varchar, email varchar, news varchar, referal varchar, staff varchar, notes 
varchar)"   
                             Top                 timhare          Post subject: 
Re: trying to create realSQLdatabase incodePosted: Sat Nov 27, 2010 12:42 am    
                     
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 8715
Location: Portland, OR  USA                If you are creating the db file in 
the same directory as the application and are running in debug mode (Run from 
the IDE as opposed to Build), then be aware that the debug app is running in a 
subfolder that will be subsequently deleted.  So any file you create "next to 
the app" will be created in the temporary subfolder and removed along with it.

You can check the DebugBuild constant to determine in code whether you are in 
debug mode and change the file path.  But it isn't good form to create a file 
in the same directory as the app anyway.  Better to use 
SpecialFolder.Documents, SpecialFolder.Desktop, or 
SpecialFolder.ApplicationData.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 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

[email protected]

Reply via email to