Android Question RDC database field content to variable in B4A

Discussion in 'Android Questions' started by Jan Kanon PA7X, May 20, 2015.

  1. Jan Kanon PA7X

    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
     
  2. DonManfred

    DonManfred Expert Licensed User

    Follow the RDC tutorial, get a RDC instance running and see the example.
     
    thedesolatesoul likes this.
  3. Jan Kanon PA7X

    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
     
  4. DonManfred

    DonManfred Expert Licensed User

    yes

    See the Tutorial.

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

    Code:
    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
     
    thedesolatesoul likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice