Try removing the cursor1.isInitialized check.
Also, in the btLer_click sub you'll get an error when indice=2. This is because you added two elements upon db's creation, thus you should have
The
SQL1.ExecNonQuery("DROP TABLE IF EXISTS sql_test")
isn't really needed, since you only insert records upon db's creation, thus the table doesn't exist.
Also, the
If SQL1.IsInitialized = False Then
SQL1.Initialize(File.DirRootExternal,"sql_test.sql", False)
End If
can be avoided, since you are initializing db at your previous steps.
Inside btLer_click, instead of loading all your records to a cursor, you can simply load the one matching the indice, IF upon db's creation, you insert an ID fields, which is strongly recommended. This way you can write for e.g.
cursor1=SQL1.ExecQuery2("SELECT nome, email, telefone FROM sql_test WHERE indice=?",Array As String (indice))
cursor1.Position=0
Finally, after getting data from the cursor, it is always a good idea to