V vdudukov Member Licensed User Longtime User Dec 18, 2013 #1 Hi, I don't know how to check database record in B4J, so if can somebody help please Thanks! Here is how I check in B4A Code: txt= "SELECT code FROM contact WHERE name = '" & edit_name.text & "'" cursor1 = SQL1.ExecQuery(txt) If cursor1.RowCount>0 Then Return Else
Hi, I don't know how to check database record in B4J, so if can somebody help please Thanks! Here is how I check in B4A Code: txt= "SELECT code FROM contact WHERE name = '" & edit_name.text & "'" cursor1 = SQL1.ExecQuery(txt) If cursor1.RowCount>0 Then Return Else
Erel B4X founder Staff member Licensed User Longtime User Dec 19, 2013 #2 Code: Dim cursor1 As ResultSet = SQL1.ExecQuery2("SELECT code FROM contact WHERE name = ?", Array As String(edit_name.text)) Dim res As Boolean If Cursor1.NextRow Then res = True Cursor1.Close Return res Upvote 0
Code: Dim cursor1 As ResultSet = SQL1.ExecQuery2("SELECT code FROM contact WHERE name = ?", Array As String(edit_name.text)) Dim res As Boolean If Cursor1.NextRow Then res = True Cursor1.Close Return res
V vdudukov Member Licensed User Longtime User Dec 20, 2013 #3 Erel said: Code: Dim cursor1 As ResultSet = SQL1.ExecQuery2("SELECT code FROM contact WHERE name = ?", Array As String(edit_name.text)) Dim res As Boolean If Cursor1.NextRow Then res = True Cursor1.Close Return res Click to expand... Thank you. This code works for me. Code: Dim cursor As ResultSet cursor = SQL1.ExecQuery("SELECT code FROM contacts WHERE name = '" & edit_name.text & "'") If cursor.NextRow Then txtLog3.Text = cursor.GetString("code") cursor.Close Else txtLog3.Text = "OK" cursor.Close End If Upvote 0
Erel said: Code: Dim cursor1 As ResultSet = SQL1.ExecQuery2("SELECT code FROM contact WHERE name = ?", Array As String(edit_name.text)) Dim res As Boolean If Cursor1.NextRow Then res = True Cursor1.Close Return res Click to expand... Thank you. This code works for me. Code: Dim cursor As ResultSet cursor = SQL1.ExecQuery("SELECT code FROM contacts WHERE name = '" & edit_name.text & "'") If cursor.NextRow Then txtLog3.Text = cursor.GetString("code") cursor.Close Else txtLog3.Text = "OK" cursor.Close End If