Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing on 4 fields in a SQL Cursor
Message
From
20/07/1999 15:01:26
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00243701
Message ID:
00243720
Views:
27
>ARGH!! I'm having troubles here, I've got a search form, which has fields at the top to search on...the grid shows the results, which now I've got it set to RECORDSOURCETYPE=1-ALIAS, and all is well as far as showing the results, but I want to allow my users to click on a header and sort by that column...preferably without requerying the SELECT statement with the ORDER BY. But when I try to
>
INDEX field TAG field
>INDEX field TAG field additive
>VFP gives me an error that a .tmp file is read-only...
>
>Is there a way to have more than one index on a cursor?
>Is there a better way I should be doing this???
>
>HEEEELP MEEE!!!! [:o

Be aware if you use the method Todd mentions to make the cursor R/W, that the resultant CDX file will NOT automatically be deleted when you close the cursor. You'll need to remove it manually:
  FUNCTION remcursor
  PARAMETER m.cursname
  PRIVATE m.filename
  IF USED(m.cursname)
    m.filename = DBF(m.cursname)
    USE IN m.cursname
    ERASE (m.filename)			&& Packed cursors don't disappear!
*
* x:\xxx\xxxxxxxx.tmp
*
    ERASE (LEFT(m.filename,LEN(m.filename)-4)+'.cdx')
  ENDIF
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform