Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on indexing on buffered cursor w/o saving modified
Message
De
11/03/2006 07:52:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/03/2006 07:15:08
Kay Alexander
Pennsylvania Farm Bureau
Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01103366
Message ID:
01103369
Vues:
11
>Hi,
>
>After spending many hours of researching and trying, I am asking for your help…
>
>I have two grids on a form. One grid (GRID1) shows all family in a household and the other grid (GRID2) shows a listing of phone numbers for a family member selected in GRID1.
>
>Each time, a different family member is selected from GRID1, I need to update GRID2 with an index file with filtering on family increment to display a proper phone listing.
>
>Ex> INDEX ON STR(tiMTPmbrno)+STR(ttMTPnincr)+STR(ttMTPtincr) TAG idx_MTP OF cdxPhonebook FOR tiMTPmbrno>0 AND ttMTPnincr=gttMNMnincr UNIQUE
>
>"tiMTPmbrno" holds a value of family member ID (all family members have the same member ID).
>
>"ttMTPnincr" holds a value of family member increment (all family members have different increment number).
>
>"ttMTPtincr" holds a value of Phone number increment for each member (each member can have several phones).
>
>"gttMNMnincr" hols a value of family member increment from GRID1
>
>In order to recreate an index file, I set a cursor to optimistic row buffering from table buffering.
>
>Ex> CUSORSETPROP("Buffering",3,"curPhonebook")
> SELECT ('curPhonebook')
> INDEX ON ……………..
> CURSORSETPROP("Buffering",5,"curPhonebook")
>
>For that, each time I select a different family member in GRID1, I am executing TABLEUPDATE to update modified phone record. Otherwise, I was getting an error message “Table buffer for alias ‘curPhonebook’ contains uncommitted changes”.
>
>I really like to find a way to save the modified phone information when I am finish working with that particular family and move on the next set of family. If any one has any recommendation on how I can address this situation, I will be very grateful.
>
>Thank you.
>
>Kay

It looks like you are unnecessarily creating an index over and over again. Would you give some sample data for these two along with what you expect to see when pointer moves in grids?
You could give sample data as a sequence of create cursor, insert into.
ie:
create cursor sample1 (myField i, myDate d)
insert into sample1 values (1,date())
insert into sample1 values (2,date()+1)
PS: You could use tablerevert() or better yet use an SQL recordsource for second grid. That wouldn't even need an index.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform