Problem with Indexes
Claudius Sailer
Claudius at sailer-online.de
Sun Dec 10 22:52:01 CST 2006
Hello,
I have an Backup-Restore-Functionality in my application. I write all
records of each table to a Textfile separated with TAB. This works
and worked fine now for years.
With Valentina 2.5 I have now this curiosity. When I reload the
database from a file I do following:
- DeleteAllRecords from every table in the sorting that no
referencation is broken or destroid
- Reading Textfile
- Writing every record back to the database
In the last process all new RecIDs are stored in an array with the
old RecID which was saved in the Textfile. So I can reproduce which
record is referenced to which other. After that I ran an Diagnose
database and got the information that database has problems in one
index. Now I added to my Importfunctionality as last step "REINDEX
DATABASE" and everything is fine.
I would expect that INDEXES are corrected and build after
DeleteAllRecords and after loading records and stored into database,
but I get always the problem. Does someone have same problem?
this is an example how I write to the database and in the last row
you can see how I write old-new-RecID
//Kategorien auslesen
if TextZeichen.countfields(chrb(9))=12 or TextZeichen.countfields
(chrb(9))=10 then
meineDatenbank.TKategorien.SetBlank
meineDatenbank.TKategorien.Kategorie_Name.Value=ASCIIToUniCode
(TextZeichen.nthfield(chrb(9),2))
meineDatenbank.TKategorien.Kategorie_Art.Value=TextZeichen.nthfield
(chrb(9),3).cdbl
meineDatenbank.TKategorien.KategorieGruppen_ID.Value=RecIDIndex
(2,TextZeichen.nthfield(chrb(9),4).cdbl)
meineDatenbank.TKategorien.SteuerFeld.Value=RecIDIndex
(11,TextZeichen.nthfield(chrb(9),5).cdbl)
if NOT CheckLeer(TextZeichen.nthfield(chrb(9),6)) then
meineDatenbank.TKategorien.LfdNr.Value=TextZeichen.nthfield
(chrb(9),6).cdbl
end if
meineDatenbank.TKategorien.MWSt.Value=RecIDIndex
(14,TextZeichen.nthfield(chrb(9),7).cdbl)
meineDatenbank.TKategorien.Sortierung.Value=TextZeichen.nthfield(chrb
(9),8).cdbl
if NOT CheckLeer(TextZeichen.nthfield(chrb(9),9)) then
meineDatenbank.TKategorien.Budget.Value=RoundTextNumber
(TextZeichen.nthfield(chrb(9),9))
end if
if NOT CheckLeer(TextZeichen.nthfield(chrb(9),10)) then
meineDatenbank.TKategorien.BudgetLaufzeit.Value=TextZeichen.nthfield
(chrb(9),10).cdbl
end if
if TextZeichen.countfields(chrb(9))=10 then //kann auch
BackUps aus der Version 3.2.3 verarbeiten
meineDatenbank.TKategorien.Beeinflussbarkeit.Value=3
meineDatenbank.TKategorien.Analysieren.value=true
else
meineDatenbank.TKategorien.Beeinflussbarkeit.Value=TextZeichen.nthfield(
chrb(9),11).cdbl
if TextZeichen.nthfield(chrb(9),12).cdbl = 1 then
meineDatenbank.TKategorien.Analysieren.value=true
else
meineDatenbank.TKategorien.Analysieren.value=false
end if
end if
NewRecID=meineDatenbank.TKategorien.addRecord
RecIDIndex(4,TextZeichen.nthfield(chrb(9),1).cdbl)
=meineDatenbank.TKategorien.RecordCount
bye
Claudius
--
iMac CD 2GHz / MacOS X 10.4de / RB 2006r4/ Valentina 2.5
Homepage http://www.ClaSai.de
iChat ryhoruk
RealBasic ListBoxes: [ I feel the need...the need for speed!!! ]
More information about the Valentina
mailing list