Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with CursorRefresh after adding a new record
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01192972
Message ID:
01192996
Vues:
13
>>>>Hi everybody,
>>>>
>>>>It looks like I can not call a CursorRefresh after a new record was added, but have to do a CursorFill instead. My problem is the following:
>>>>
>>>>I have a parent grid and a child grid both bound to different CAs. When I navigate through parent grid I call child's CA CursorRefresh and everything is fine. My problems starts when I add a new record into the child table and save the information. Now CursorRefresh does nothing and the child grid still shows the last added record.
>>>>
>>>>Is it a bug? How should I workaround the problem if I don't want to lose my grid's controlsources?
>>>>
>>>>Thanks a lot in advance.
>>>
>>>What AERROR() said after CursorRefresh()?
>>
>>Ok, I'm back to square one with the original problem of AutoInc field <g> Since I'm using VFP8, I save the current ID by reading it from the table in AfterInsert and in my Save method I replace ID with the saved ID in CA.Alias and reset setfldstate for the PK field. Somehow it's not enough and I now get this error message. So, the question goes back - how can I "refresh" my CA AutoInc field in VFP8.
>
>Instead of getting the ID back and REPLACE it in ID field , can't you REFRESH() the cursor AFTER TableUpdate():
>
>IF TableUpdate(1, .t., CA.Alias)
>   *** Set all parameters you need here
>
>   CA.CursorRefresh()
>ESLE
>   *** error handling here
>ENDIF
>
When I refresh CA after tableupdate I still don't get PK in my CA, it remains empty.

In other words, I add a new record to the parent table, I save the information and now I need to add a record to the child, but I keep receiving the message that I need to save the parent first (since my ID is still empty).
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform