Greetings,
It seems that i get weird things on mysql while running an update on some fields.
So i have 17 Records in total that i have to go trough and update data , well, it goes to the first record and then it stops saying that it reached to the end of the file but actually there are 16 more to go , any idea why ?
I`m using Xojo 2016R4.1
The code is the following :
query = "SELECT * FROM photos"
rs = app.sqlBase.SQLQuery(query)
If rs <> Nil Then
dim rc As Integer
rc = rs.RecordCount
rs.Edit
While Not rs.EOF
If Not App.sqlBase.Error Then
pid = rs.Field("patient_id").StringValue
pname = rs.Field("file").StringValue
dim thumbnailAI As FolderItem = app.patientFolderItem.Child("C"+ pid).Child("photos").Child(pname)
pictureBuffer = Picture.Open(thumbnailAI)
pictureBuffer.Save(thumbnailAI, Picture.SaveAsJPEG)
thumb = pictureBuffer.resize(128,128)
rs.Field("pict").PictureValue = thumb
rs.Update
if App.sqlBase.error then
MsgBox("There was an error" + EndOfLine + app.sqlBase.ErrorMessage)
end if
rs.MoveNext
Else
MsgBox("There was an error" + EndOfLine + app.sqlBase.ErrorMessage)
End If
Wend
rs.Close
End If
Thanks in advance .