Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help! VFP 7 broke my VFP 6 code
Message
De
01/10/2001 12:18:17
 
 
À
01/10/2001 11:35:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00562021
Message ID:
00562620
Vues:
28
I think I know what is causing this. In VFP6, if you issue an ALTER TABLE on a cursor with one or more long fieldnames (>10 chars long), the long fieldnames are silently truncated to 10 characters. This happens because in the background ALTER TABLE makes a new free DBF and deletes the original. Because this is a free table, the fieldname lengths are limited to 10 characters. To prevent this silent truncation from happenening in VFP7, we now throw the error "Invalid operation for the cursor" when attempting ALTER TABLE on a cursor with long fieldnames.

Try the following code in VFP6 and VFP7. The field field_name1 is renamed to field_name in VFP6. VFP7 throws the error on the ALTER TABLE command.

CLEAR
CREATE CURSOR testcur (field_name1 c(8))
LIST STRUCTURE
ALTER TABLE testcur ADD COLUMN f2 c(8)
LIST STRUCTURE
RETURN


Please let me know if you are seeing something different than what I describe above.

Jim Saunders
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform