test_05.bmx 631 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. SuperStrict
  2. Framework Database.SQLite
  3. Import BRL.filesystem
  4. Import brl.standardio
  5. Local db:TDBConnection = LoadDatabase("SQLITE", "maxtest.db")
  6. If Not db Then
  7. Print("Didn't work...")
  8. End
  9. End If
  10. If db.hasError() Then
  11. errorAndClose(db)
  12. End If
  13. If db.isOpen() Then
  14. ' get a list of tables in the database
  15. Local list:String[] = db.getTables()
  16. If list Then
  17. For Local i:Int = 0 Until list.length
  18. Print(" " + (i + 1) + ". " + list[i])
  19. Next
  20. End If
  21. db.close()
  22. End If
  23. Function errorAndClose(db:TDBConnection)
  24. Print(db.error().toString())
  25. db.close()
  26. End
  27. End Function