Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange behavior using REPLACE command
Message
De
06/06/2003 10:37:13
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
06/06/2003 09:46:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00797167
Message ID:
00797247
Vues:
33
If you start out at EOF, you wouldn't get any replaces. Browsing would move the record pointer artificially. Try a go top after the append.

Is there an ORDER set on the target table? Changing a record with the order active can result in the changed record becoming the last record in that sequence and the replace would stop. Try SET ORDER TO.

Are you using REPLACE targetalias.field with sourcealias.field in targetalias? You need not preface the target field.

>By the way, I ran the same code on another machine networked to the same data and the results are the same.
>
>>I'm a little sheepish posting this, but I am experiencing wierd behavior which is kicking my butt, so I need some input.
>>
>>I'm using a procedure call from a screen that is importing data to a non-buffered table. I'm using a simple method of APPEND BLANK to my target table and then using REPLACE field WITH value IN TARGETTABLE. My APPEND BLANK is working and my table is populated with primary keys being generated in my DBC code. However, NONE of my replace statements are populating the table. The target table is completely blank except for the primary key values. Here are some conditions:
>>
>>-The table is not buffered, confirmed with both CURSORGETPROP('buffering') and attempting a TABLEUPDATE, which fails since table is not buffered.
>>-The target table is selected during the REPLACE commands(which shouldn't matter anyways, I'm using REPLACE IN tablename
>>-The correct datasession is active
>>-I reindexed the table, no effect
>>-ERROR handling is turned off, and I'm not getting any error messages on any REPLACE commands (confirmed running through debugger).
>>-This is where it gets wierd, if I run the code in the debugger and in the middle of the REPLACE statements I BROWSE the table, then the fields begin to get populated with values as I continue to STEP through the REPLACE commands. If I close the browse and continue on, then the table is not getting updated past that point when I closed the browse. However, any values that were entered while the browse was active still remained saved in the table.
>>-If I simply open up the table all by itself in a VFP session and issue append blanks and REPLACE in the command window, the table is updating correctly
>>-Not sure if it's relative, but I've gotten an occasional internal consistancy error over the last week in VFP.
>>-I'm using VFP6.0 and XP
>>
>>Perhaps it's time to reinstall VFP?
>>
>>Thanks in advance.
>>
>>Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform