Thread: SQL Tutorial
View Single Post
  #4 (permalink)  
Old 06-30-2009, 02:19 PM
BjornF BjornF is offline
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 173
Default

Thank you for the tutorial Erel.

I'm wondering about the "Creating_tables" part more specifically about:

Code:
Sub CreateTableIfNotExists

   
'Find all the tables in this database

   Command.CommandText = 
"SELECT name FROM sqlite_master WHERE type = 'table' AND name='t_orders'"

   
'instantiate reader

   Reader.New1

   
'Fill reader

   Reader.Value = Command.ExecuteReader

   
If Reader.ReadNextRow = True Then

      
' No table with this name in the database.
I understand that you do a search / select on the database, but if no table with "t_orders" exists in that database, doesn't the Reader.ReadNextRow return False? I.e. shouldn't the last code line say
"If Reader.ReadNextRow=False Then "

or have I misunderstood something?

all the best / Björn
Reply With Quote