Android Question RDC and MySQL

Discussion in 'Android Questions' started by dunkelbunt, May 26, 2015.

  1. dunkelbunt

    dunkelbunt New Member Licensed User

    Hello,
    I'm new in dealing with B4A. To get experience I'm trying some Examples.
    For now I'm dealing with RDC und access to Mysql.
    MySQL and RDC are up und running well.
    I'd like to read some rows from a Mysql-table.
    But, if i try to the following statement from config.properties
    Code:
    sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = ?
    with this B4A code
    Code:
    Sub GetPerson(Nummer As String)
       
    Dim cmd As DBCommand
       cmd.Initialize
       cmd.Name = 
    "select_personal"
       cmd.Parameters = 
    Array As Object("29")
       reqManager.ExecuteQuery(cmd, 
    0"GetPerson")
       
    Log ("Nummer " & Nummer )
    End Sub
    I'm getting no result:
    Code:
    Tag: GetPerson, Columns: 2, Rows: 0
    persnr   sname
    If I use
    Code:
    sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = 29
    then it works, like expected.
    Code:
    Tag: GetPerson, Columns: 2, Rows: 1
    persnr   sname
      
    29   Krumenau Heinz
    What am i doing wrong?

    Fred
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It should be:
    Code:
    cmb.Parameters = Array (29'which is the same as: Array As Object(29)
     
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