Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seek record in cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00410485
Message ID:
00410584
Vues:
15
>>>Hi All,
>>>
>>>Is it possible to seek a record in a cursor, I can't seem to do this and was hoping for some guidance.
>>>
>>>Here's the sql in my grids recordsource:
>>>
>>>select name, yr_bred from master where type = "B" order by name into cursor addfoal noconsole
>>>
>>>The grids recordsourcetype is set to 4-SQL statement.
>>>
>>>There is a textbox on the form where the user may enter the record they desire and I would like for them to be able to "Seek" the record but I'm getting a "table not indexed" message.
>>>
>>>The idea would be for the grid to be refreshed with the record being "seeked" showing up in the middle of the grid itself.
>>>
>>>The sql creates a cursor with about 15,000 records from a table of 23,000+.
>>>
>>>Any help would be appreciated.
>>>
>>>Thanks,
>>>
>>>Jim Harvey
>>>jharvey@netrax.net
>>
>>In order to issue a SEEK on a recordset, there has to be an index on the field.
>
>
>
>Is it possible to included an "index on name to name" in the grids recordsource property box??? I guess the "order by name" doesn't do it and I tried this which doesn't work of course "select name, yr_bred from master where type = "B" order by name into cursor addfoal noconsole inde on name to name".
>
>Sorry for being dense but I think I understand the concept, just can't find how to apply it.
>
>Can I create the cursor in the init of the form and then set the grids recordsource to it as a property???

Your cursor has to be updatable in order to create index (index on command).
To make cursor updatable you can either create it in Init method of your form (or the grid) (Create Cursor command) or use dbf('myCursor') again alias myUpdatableCursor or wait till VFP 7.0, where we will have ReadWrite option :)
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