Sub mnuRefresh_Click 'Fills the TreeView with the tables and columns
data
for i = 0 to Tree.Count - 1
Tree.RemoveNodeAt(0)
next
Con.BeginTransaction 'Starts a block of I/O with the database.
cmd.CommandText = "SELECT name FROM sqlite_master WHERE type =
'table'" 'Finds all the tables in this database
Reader.Value = cmd.ExecuteReader
Do while reader.ReadNextRow = True
Tree.AddNewNode(reader.GetValue(0))
loop
Reader.Close
for i = 0 to Tree.Count - 1
Node.Value = Tree.GetNode(i)
cmd.CommandText = "PRAGMA table_info ('" & Node.Text & "')" 'Special SQLite command to find the table's metadata.
reader.Value = cmd.ExecuteReader
Do while Reader.ReadNextRow
= True
Node.AddNewNode(Reader.GetValue(1) & " : " &
Reader.GetValue(2))
Loop
Reader.Close
next
Con.EndTransaction
End Sub
Sub Form2_Show
if Tree.Count = 0 then mnuRefresh_Click
End Sub
Sub Form1_Close
Con.Close
End Sub