Android Question CursorIndexOutofBoundsException

ProjectGroup19

Active Member
Licensed User
Try
Dim RowId As Long = GetRowId(Sender)
Connection.CU=Connection.DB.ExecQuery2("SELECT USERNAME FROM ACCOUNT WHERE rowid=? ",Array As String(RowId) )
Connection.CU.Position=0
Dim name As String=Connection.CU.GetString("USERNAME")
If name= "ADMIN" Then
Msgbox("You can not delete this account.","ADMIN ACCOUNT")
Return
Else
Dim Item As Map = B4XTable1.GetRow(RowId)
Dim sf As Object = xui.Msgbox2Async($"Delete Account: ${Item.Get("USERNAME")}?"$, "", "Yes", "", "No", Null)
Wait For (sf) Msgbox_Result (Result As Int)

If Result = xui.DialogResponse_Positive Then
B4XTable1.sql1.ExecNonQuery2("DELETE FROM data WHERE rowid = ?", Array(RowId))
Connection.DB.ExecNonQuery2("DELETE FROM ACCOUNT WHERE rowid = ?", Array(RowId))
Connection.DB.ExecNonQuery2("DELETE FROM USER WHERE rowid = ?", Array(RowId))
B4XTable1.ClearDataView 'update the table
End If
End If


Catch
Msgbox(LastException.Message, "Error")
End Try
 

walterf25

Expert
Licensed User
Longtime User
SOM

Someone should kindly help me out
Bro, that means you are not getting any data back from the Query, index 0 requested, with a size of 0 means that there's no data being returned.

Walter
 
Upvote 0
Top