D dunkelbunt New Member Licensed User Longtime User May 26, 2015 #1 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: Copy sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = ? with this B4A code Code: Copy 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: Copy Tag: GetPerson, Columns: 2, Rows: 0 persnr sname If I use Code: Copy sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = 29 then it works, like expected. Code: Copy Tag: GetPerson, Columns: 2, Rows: 1 persnr sname 29 Krumenau Heinz What am i doing wrong? Fred
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: Copy sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = ? with this B4A code Code: Copy 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: Copy Tag: GetPerson, Columns: 2, Rows: 0 persnr sname If I use Code: Copy sql.select_personal=SELECT persnr, sname FROM t_personal WHERE persnr = 29 then it works, like expected. Code: Copy Tag: GetPerson, Columns: 2, Rows: 1 persnr sname 29 Krumenau Heinz What am i doing wrong? Fred
Erel B4X founder Staff member Licensed User Longtime User May 27, 2015 #2 It should be: Code: Copy cmb.Parameters = Array (29) 'which is the same as: Array As Object(29) Upvote 0