B4J Question Read write data base getting disc error

tsteward

Well-Known Member
Licensed User
Longtime User
I am trying to encrypt some fields in my sql data base to give it some protection. As this db is used on both B4J and B4A I figured this was the easiest way to go.

Anyway I get disc errors with so many read writes. seams to happen at different record number each time it runs. There must be a better way.

Error

My Code:
B4X:
Sub EncryptBTN_MouseClicked (EventData As MouseEvent)
    Dim RS As ResultSet = sql1.ExecQuery("SELECT * FROM Vehicles")
   
    Total = RS.ColumnCount
    current = 0
    Do While RS.NextRow
        current = current + 1
        Log(current)
        EncData = b64.EncodeStoS(RS.GetString("Info"),"UTF8")
        sql1.ExecNonQuery("UPDATE Vehicles SET Info = '" & EncData & "' where VehicleID = '" & RS.GetString("VehicleID") & "'")
    Loop
    RS.Close
    sql1.Close
   
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…