Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a free table in Private Data Session
Message
 
À
28/08/1997 20:14:19
Edward Crawford
City Facilities Management
Glasgow, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00047219
Message ID:
00047481
Vues:
21
>Hi Barbara:
>
>I went ahead a did what you said. I think I discovered the problem. When I add a record to a table, I call a method that is not in the form. Here is the method (lcTable is the alias name of the table to add a record to)
>
>LPARAMETERS lcTable
>
>PRIVATE oldOrder
>
>SELECT &lcTable
>oldOrder = ORDER()
>
>SET ORDER TO deleted
>SET DELETED OFF
>SEEK .T.
>IF FOUND()
> RECALL
> SET DELETED ON
>ELSE
> SET DELETED ON
> APPEND BLANK
>ENDIF
>
>SET ORDER TO oldOrder
>
>When I do this I can see the data session changing from my private form DE to the default one, obviously because the method is not in the form. When I return to my form to REPLACE the data, the table is sitting on Record #1, not on the blank record. I don't see any way around this without placing this method in my form.
>
>Ed

Ed, this method shouldn't change the datasession. However, it DOES seem you have a record pointer problem. Add 2 lines of code:
.....
  APPEND BLANK
  nRec = recno()
ENDIF

SET ORDER TO oldOrder
go nRec
This way you force a return to the appended record. In addition, I'd move the SET DELETED ON code to just before the SET ORDER TO oldOrder line. That way you only write it once and it doesn't interfere with setting the correct record.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform