Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View Gone Buggy
Message
De
02/09/1998 01:06:28
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00132060
Message ID:
00132211
Vues:
24
>I have a view, "locations_by_client_number" (I didn't realize how many times I'd be typing it when I named it. :)
>
>This view is used in a grid and has parameters cnum and topnum. I can requery the view with different values as much as I want with no problems. I can delete records from the view without problems. But when I add a record, the thing goes buggy!
>
>After adding a record, I cannot do anything with the view, inside or outside the (modeless) form. If I try to close it, browse it, requery it, etc, I get three errors in a row: 1. alias not found, 2. canceling procedure, 3. record is not locked.
>
>This happens even if I click on the view in VFP's DE, and click browse!
>
>The only thing I was able to do with it is get '.T.' to the command "? USED('locations_by_client_number'). So it knows it's there.
>
>I can't close the form, I can't close VFP. I had to do and end task and I still got the errors before it decided to give up the ghost.
>
>I also had another problem with this view. I accidentally double-clicked on the "add" button. It tells me it can't insert a blank row from the view to the base tables. After that, I can't do anything, and I keep getting that error. I can't browse the view to get rid of the blank row, I can't close it, I can't close VFP.
>
>This is my first real attempt at using views, and if this is the headache I can expect, it'll be my last attempt.
>
>Anyone have any idea what's going on?
>
>Thanks,
>
>-Michelle
Part of your problem is that you should be appending records with a pre-determined key values using INSERT INTO and not APPEND. For example, say that your table has a primary index on a field CKEYFIELD, you would either get the next key value from your keyid table or use something like sys(2015) to generate a unique value. If you use the latter your "ADD" method would be something like...

STORE SYS(2015) TO m.ckeyfield
INSERT INTO yourview (ckeyfield) VALUES (m.ckeyfield)

Then to save you issue a TABLEUPDATE command.

If you get an error while developing the form, you need to issue a TABLEREVERT command. In the form.LOAD method, you might want to have something like...

ON KEY LABEL F12 =TABLEREVERT(.T.,"locations_by_client_number")

Hope this gets you going again.
//:^)
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform