Android Question RDC database field content to variable in B4A

Jan Kanon PA7X

Member
Licensed User
I am succesful working with RDC connected to a backend SQLserver 2012 database. I was wondering is there an easy way to transfer database field content to a variable in B4A. i.e.
strEmpname = tableHREmployee.Field("Empname"). Now the results are put into the Log screen by Printable.

Please if anyone has suggestions let me know

Regards, Jan H Kanon
 

Jan Kanon PA7X

Member
Licensed User
Hi Manfred,

Thanks for your reaction, unfortunately I can only find the Tutorial of RDC in Spanish and the examples are as far as I can see not about retrieving database info into separate variables or did I miss something ?

Regards, Jan
 

DonManfred

Expert
Licensed User
or did I miss something ?
yes

See the Tutorial.

And see the example-code in this tutorial...

B4X:
Sub JobDone(Job As HttpJob)
   If Job.Success = False Then
     Log("Error: " & Job.ErrorMessage)
   Else
     If Job.JobName = "DBRequest" Then
       Dim result As DBResult = reqManager.HandleJob(Job)
       If result.Tag = "cat 1" Then 'query tag
         For Each records() As Object In result.Rows
           Dim name As String = records(0) 'or records(result.Columns.Get("name"))
           Log(name)
         Next
       End If
     End If
   End If
   Job.Release
End Sub
 
Top