New topic: 

Check for existance of a table

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

       Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic         Author  
Message       dplaut           Post subject: Check for existance of a 
tablePosted: Sat Dec 05, 2009 9:53 pm                        
Joined: Mon Jun 23, 2008 3:04 pm
Posts: 58              What is an efficient way to check if a table exists in a 
database?   
                            Top                Phil M           Post subject: 
Re: Check for existance of a tablePosted: Sat Dec 05, 2009 10:17 pm             
           
Joined: Fri Sep 30, 2005 12:18 pm
Posts: 573              Put in a Module with Global scope:
Code:Function TableExists(Extends Db As REALSQLdatabase, tableName As String) 
As Boolean
  Dim rs As RecordSet = Db.SQLSelect("SELECT _rowid_ FROM [SQLITE_MASTER] WHERE 
" + "[type]='table' AND [name]='" + tableName + "'")
  Return (rs.RecordCount > 0)
End Function
   
                            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