Database corruption with V4MD 2.4.3
Pierre Rossel
prossel2 at myrealbox.com
Tue Nov 7 16:25:29 CST 2006
Hello,
I get my database corrupted by doing simple updateRecord on all records of a
cursor.
The table has 800 records and Vstudio 2.4.3 diagnoses no problem. I build a
cursor with:
SELECT mediaData FROM MediaItem WHERE collectionCode='TEST'
Then for each record, I eventually modify the mediaData field (remove some
trailing white spaces) and updateRecord(). In total I have about 100 records
updated.
Then going back to Vstudio, diagnose show errors on table MediaItem. Here is
the extract of the full details story:
==========> Field: mediaData , type Text
==========> IndexFile
PAGE (0, 0) Inventory pages have wrong physical page number.Inventory pages
have wrong sum of physical page numbers.Index Inventory pages CORRUPTED.
Some big page is not marked as first.
Problems found! ( IndexFile )
First Segment 6619219 of record with RecID = 1 is bigger of the last segment
9965
Problems found! ( Field: mediaData , type Text )
Problems found! ( Table: MediaItem )
Here is the code:
sSql = "SELECT mediaData FROM MediaItem WHERE collectionCode='JEM'"
cur = db.Query(sSql, #DefaultSave) -- returns a Valentina cursor
if not voidP(cur) then
bFound = cur.firstRecord()
repeat while bFound
bModified = false
sData = cur.field("mediaData").value & ""
repeat while [" ", RETURN, TAB].getPos(sData.char[sData.length])
bModified = true
delete the last char of sData
end repeat
if bModified then
cur.field("mediaData").value = sData
cur.updateRecord()
--cur.updateRecord([#mediaData: sData])
db.HandleError()
if db.getError() then
alert "Error updating record"
exit repeat
end if
end if
bFound = cur.nextRecord()
end repeat
end if
I tried with 2.5b11, but I had other problems (Director crashes) that made
me rollback to 2.4.3.
Thank you for any help.
Pierre Rossel
More information about the Valentina
mailing list