Android Question failure dbutils.executemap

angel

Member
Licensed User
Longtime User
Hello

I am running dbutils.executemap to read BD data and gives me error

B4X:
QueryPM = "SELECT * FROM " & DBTableName & " WHERE ID = 3"
    Dim QueryPMMap As Map
    QueryPMMap.Initialize
    QueryPMMap = DBUtils.ExecuteMap(SQL1, QueryPM, Null)
    If QueryPMMap = Null Then
        lblspSelectPrimer.Text = "N/A"
    Else
        lblspSelectPrimer.Text = QueryPMMap.Get("primerMedicament")
    End If

Thanks
 

LucaMs

Expert
Licensed User
Longtime User
Hello

I am running dbutils.executemap to read BD data and gives me error

B4X:
QueryPM = "SELECT * FROM " & DBTableName & " WHERE ID = 3"
    Dim QueryPMMap As Map
    QueryPMMap.Initialize
    QueryPMMap = DBUtils.ExecuteMap(SQL1, QueryPM, Null)
    If QueryPMMap = Null Then
        lblspSelectPrimer.Text = "N/A"
    Else
        lblspSelectPrimer.Text = QueryPMMap.Get("primerMedicament")
    End If

Thanks


Viewed this way, there are no errors.

Are you sure of the names of the fields?

Post the error log.
 
Upvote 0

angel

Member
Licensed User
Longtime User
Hello

If the fields in the database are correct, attached one image with the error in the module.

Dim DBFileName As String : DBFileName = "DosisFiebreDB.db"
Dim DBFileDir As String : DBFileDir = File.DirDefaultExternal
Dim DBTableName As String : DBTableName = "taula_temporitzador"

Thank you.
 

Attachments

  • Data base.png
    Data base.png
    20.5 KB · Views: 211
  • error.png
    error.png
    208.9 KB · Views: 230
Last edited:
Upvote 0

angel

Member
Licensed User
Longtime User
Hello

Works "primerMedicament" field in the database included a space "primerMedicament "

Thank you.
 
Upvote 0
Top