B4A Library SD: SqliteExtra

This new library is used to add some functions to the already precious SQL library.
  1. Insertion, updating and reading of images in fields of type BLOB.
  2. Functions to add a table, a field. Update a field. Delete a row or table.
  3. List of tables, fields and typos of the fields contained in the database
  4. Commands to populate List and ListView also with images.

SD_SqliteExtra

Author:
Star-Dust
Version: 1.03
  • sqlite
    • Fields: (TypeBase)
      • TypeFieldBlob As String
      • TypeFieldInteger As String
      • TypeFieldNumeric As String
      • TypeFieldReal As String
      • TypeFieldText As String
    • Functions:
      • AddField (FileNameDB As String, NameTable As String, NameField As String, TypeField As String, defaultValue As String) As Boolean
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.AddField("mysql.db","mytable","myfield","")
        sq.AddField("mysql.db","mytable","myNumberfield","0")
      • AddTable (FileNameDB As String, NameTable As String, Fields As String, CreateIfNecessary As Boolean) As Boolean
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.AddTable("mysql.db","mytable","ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Number INTEGER default 0, Name TEXT default ''")
      • Class_Globals As String
      • DeleteRow (FileNameDB As String, NameTable As String, Condition As String) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.DeleteRow("mysql.db","mytable","ID=1")
      • DeleteTable (FileNameDB As String, NameTable As String) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.DeleteTable("mysql.db","tableOld")
      • Initialize As String
        Initializes the object. You can add parameters to this method if needed.
      • InsertBitmap (filenameDB As String, TableName As String, Field As String, Bm As Bitmap) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.InsertBitmap("mysql.db", "mytable", "imageField", LoadBitmap(File.DirInternal,"myimage.png"))
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • getListTable(Path As String,FileName As String) As List
      • getListFieldName(Path As String,FileName As String, TableName As String) As List
      • getListFieldTypeBase(Path As String,FileName As String, TableName As String) As List
      • getListFieldTypeName(Path As String,FileName As String, TableName As String) As List
      • PopulateList (FileNameDB As String, NameTable As String, FieldName As String, Condition As String) As List
        Example:
        Dim sq as sqlite
        sq.initialize
        Dim L As list = sq.PopolateList("mysql.db","mytable","Name", "")
      • PopulateListTwoLine (FileNameDB As String, NameTable As String, FieldName As String, FieldSecondLine As String, FieldID As String, Condition As String, LV As ListView, CLearListView As Boolean) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.PopolateListTwoLine("mysql.db","mytable","City","State","ID", "", ListView1,True)
      • PopulateListTwoLineBitmap (FileNameDB As String, NameTable As String, FieldName As String, FieldSecondLine As String, FieldID As String, FieldBitmap As String, Condition As String, LV As ListView, CLearListView As Boolean) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.PopolateListTwoLine("mysql.db","mytable","City","State","banner","ID", "", ListView1,True)
      • PopulateListView (FileNameDB As String, NameTable As String, FieldName As String, FieldID As String, Condition As String, LV As ListView, CLearListView As Boolean) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.PopolateList("mysql.db","mytable","CityField","ID", "", ListView1,True)
      • readBitmap (filenameDB As String, TableName As String, Filter As String, Field As String) As Bitmap
        Example:
        Dim sq as sqlite
        sq.initialize
        Dim B as Bitmap = sq.readBitmap("mysql.db", "mytable","ID=1", "imageField")
      • UpdateBitmap (filenameDB As String, TableName As String, Filter As String, Field As String, Bm As Bitmap) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.UpdateBitmap("mysql.db", "mytable","ID=1", "imageField", LoadBitmap(File.DirInternal,"myimage.png"))
      • UpdateField (FileNameDB As String, NameTable As String, FieldName As String, Value As String, Condition As String) As String
        Example:
        Dim sq as sqlite
        sq.initialize
        sq.UpdateField("mysql.db","mytable","NumberField", "100", "ID=1")
        sq.UpdateField("mysql.db","mytable","StringField", "'StringValue'", "ID=1")

1.png
2.png


video1.gif
 

Attachments

  • example2.zip
    62.9 KB · Views: 689
  • example1.zip
    99.3 KB · Views: 702
  • SD_SqliteExtra 1.04.zip
    7.4 KB · Views: 724
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Cool that it's coming for b4j. You might need to consider availing using map variables for your filters. I like what you are doing here..
The ideas have become many and the class has become very complex.
I'll have to make a library just for this BindingNavigator class.
 

Star-Dust

Expert
Licensed User
Longtime User
Update 1.02
Add this method
  • getListTable(Path As String,FileName As String) As List
  • getListFieldName(Path As String,FileName As String, TableName As String) As List
 

Star-Dust

Expert
Licensed User
Longtime User
Hey Star!
Nice improvement!
Will this work the other way 'round?
I mean, view updates will also be applied to the associated database field, like VB "bound controls" do?
You could also associate database boolean fields to checkbox and/or button views.
Spare some time to think about it... ;)
Wizard for creating mask from SQL is now a reality ... here :D:D:D:D:D:D:D:D
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update release 1.04

  • getListFieldTypeBase(Path As String,FileName As String, TableName As String) As List
  • getListFieldTypeName(Path As String,FileName As String, TableName As String) As List
 

Star-Dust

Expert
Licensed User
Longtime User
Cool that it's coming for b4j. You might need to consider availing using map variables for your filters. I like what you are doing here..
Are you willing to test the B4J version?

See here
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
I do want

Now it is available in B4J version here

In addition, the Sqlite browser, which allows you to automatically update the contents of the views (EditText, Label, ImageView, etc ..) changing only the position of the cursor of the DataBase, is available yes for B4A and B4J
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
[QUOTE = "Star-Dust, post: 575506, member: 101440"] Ahora está disponible en la versión B4J aquí

Además, el navegador Sqlite, que le permite actualizar automáticamente el contenido de las vistas (EditText, Label, ImageView, etc.) cambiando solo la posición del cursor de la Base de Datos, está disponible sí para B4A y B4J [/ QUOTE ]

Excelente
 
Top