Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SEEK Always Finds the Data!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01190437
Message ID:
01190445
Vues:
17
>>Hi Gang!
>>
>>A weird one today!
>>
>>I was adding a form to a system that is in the field.
>>
>>This form was designed to be as similar as the other forms already in the system (I inherited the system).
>>
>>Now, the form uses the Default Data Session with CURSORSETPROP("Buffering",5,"PSE_drug").
>>
>>The data is bound to the controls through setting the controlsources in the INIT of the form.
>>
>>Now, this one text control, called txtUPCNDC is bound to PSE_drug.upc_ndc and the PSE_drug table has an index on this field (index is UPC_NDC). The table is a FREE table.
>>
>>When you press ADD to add a new record, the 1st thing it does is add a BLANK record which is bound to the controls (so we have blank values in the controls).
>>
>>Now the user can ENTER values into the blank record.
>>
>>Now, when you SAVE the record, I wanted to make sure that you check the UPCNDC value and make sure it WAS NOT already in the PSE_drug table index.
>>
>>So, the code calls this code....
>>
>>
>>This is BEFORE that record is saved.
>>
>>The problem is, the SEEK ALWAYS comes out TRUE, even if I input total garbage in the text control. Yet, when I try the same thing by hand by just opening up the table and index and doing the SEEK(), it comes out FALSE when it ought to, and TRUE when it should.
>>
>>And ideas? A Buffering problem I've overlooked. Basic knowledge that I've overlooked in trying to get too fancy?
>>
>>Thanks!!
>
>If the controls are bound, you're actually adding a new record with this key to the table, so no wonder it would be always found.
>
>SEEK operates on a buffered table, Select-SQL on the table from the disk (if BUFFERING clause is not used).

Yeah, I thought so. Thanks a bunch! You and Mike saved me a lot of head scratching!!
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform