Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP CDX bug confirmed
Message
De
19/02/1999 20:00:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
VFP CDX bug confirmed
Divers
Thread ID:
00189588
Message ID:
00189588
Vues:
65
In a recent thread titled "Structural CDX not being updated ???" (Databases) I reported a situation in which my CDX indexes were not being updated when new records were added in a form. I reported a demonstation case in Visual Fox Express to Toni Feltman of F1 Technologies and she has confirmed that this is a bug which appears in both VFP 5.0 and the current release of VFP 6.0.

Here is program which will demonstrate the bug:



*********************************************************************
* PROCEDURE PRCDXBUG.PRG
*********************************************************************
* Purpose.....: Demonstrate a VFP 5.0 and 6.0 bug where a production
* CDX index file is not updated properly.
* Notes.......:
* These conditions produce the error:
* A table (CDXBUG) with a primary key in created in a database.
* A form is created to update the table in datasession 2.
* The form precedes the update with BEGIN TRANSACTION.
* The table is opened in datasession 1 with "NOUPDATE".
* Records added in the form will not effect the indexes in the CDX.
* Parameters..: none
* Authors.....: Toni Feltman (F1 Technologies)
* Peter Robinson (Rodes Software)
* Created.....: 1999.02.19
* History.....:
********************************************************************

local loForm

close databases all

if not file("CDXBUG.DBF")
create database ShowBug
create table CDXBUG (iCDXBUG i primary key)
endif

if used("CDXBUG")
use in CDXBUG
endif

set exclusive off
set multilocks on
select 0
use CDXBUG noupdate

loForm = createobject("TestForm")

if type("loForm.Name") = "C"
with loForm
.AddRecord(100)
.SaveRecord()
.AddRecord(200)
.SaveRecord()
endwith
endif

if used("CDXBUG")
use in CDXBUG
endif

use CDXBUG
set order to tag iCDXBUG
clear
? "List of CDXBUG table according to tag iCDXBUG:"
list iCDXBUG
set order to
? "List of CDXBUG table with no tag:"
list iCDXBUG
? "Duplicate records will be added if PRCDXBUG is run again."
use

return



define class testform as form

datasession = 2
docreate = .t.
caption = "Form2"
name = "testform"

procedure init
set multilocks on
select 0
use CDXBUG again shared
=cursorsetprop("Buffer", 3)
endproc

procedure destroy
close databases all
endproc

procedure AddRecord
lparameters ;
tnValue
select CDXBUG
append blank
replace iCDXBUG with tnValue
endproc

procedure SaveRecord
begin transaction
if not tableupdate(.t.)
rollback
else
end transaction
endif
endproc

enddefine
Peter Robinson ** Rodes Design ** Virginia
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform