Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange behavior using REPLACE command
Message
De
06/06/2003 09:39:40
 
 
À
06/06/2003 09:32:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00797167
Message ID:
00797207
Vues:
19
Hi again

Then I am out of ideas. Since I am about to take the weekend off, I have turned my brain to idle mode <g>!

However, I have had so many problems over the years with the REPLACE command not always doing it's job properly, that I now always use the SQL INSERT command instead. It usually is just as fast as REPLACE, and it is always doing the job safely.

>Thanks for responding Tore. However, that's not the issue unless I am misunderstanding you. As you will note in my post, I have the table SELECTED prior to the replace statement. Besides, I'm using the IN clause of the REPLACE statement which would not require the table to be selected in the first place.
>
>Jim
>
>>Hi Jim
>>
>>If your current record number in the active work area is 0 or at the so called phantom record (reccount()+1), you will have this result. Simply switch to the relevant work area first with SELECT tablename, and your problems are gone.
>>
>>>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
Répondre
Fil
Voir

Click here to load this message in the networking platform