Hello. I'm having difficulty with an update statement I was hoping someone could help me with. When I run the following code, all the data seems to follow through the variables like it's supposed to (I checked by inserting a msgbox at the end), but the data simply doesn't appear in my table. What am I missing here?
I'm attaching the whole program so if someone wants to take a stab at it they can. What's supposed to happen is that when a checkbox is clicked on the Actions form the database updates action_used to true.
Thanks to any and all for looking at it.
-David
B4X:
Sub Chkbx_click
basestring = Sender
newstring = StrReplace(basestring,"chkbx","")
newactionname = Control("btn" & newstring).text
If Control("chkbx" & newstring).checked = True Then
newactionused = "True"
Msgbox(newactionname & " " & newactionused)
Else newactionused = "False"
End If
Connection.BeginTransaction
Command.AddParameter("ActionName")
Command.SetParameter("ActionName", newActionname)
Command.AddParameter("ActionUsed")
Command.SetParameter("ActionUsed", newActionused)
Command.CommandText = "UPDATE Actions SET Action_Used=@ActionUsed WHERE Action_name=@ActionName"
Command.ExecuteNonQuery
Connection.EndTransaction
End Sub
I'm attaching the whole program so if someone wants to take a stab at it they can. What's supposed to happen is that when a checkbox is clicked on the Actions form the database updates action_used to true.
Thanks to any and all for looking at it.
-David