Solved

Set Index on a non index dbf

Posted on 2010-11-16
5
467 Views
Last Modified: 2012-05-10
I select MyTable.dbf and it has 4 fields, fld1, fld2, fld3, fld4

no index I seen the othe day an Exper was typing to set index on xxx TAG sort order then select I beleive.

can any one clarify?
OPEN DATABASE C:\MyFolder\Data\DB.dbc SHARED
* Set Index
	Index On fld1 + fld2 + fld3 TAG sortorder
	Select * ;
	from MyTable ;
	order By fld1, fld2 Into Cursor cMycursor Readwrite

	Browse

Thanks

Scan
....
ENDSCAN

Open in new window

0
Comment
Question by:jaymz69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 2

Accepted Solution

by:
Gary2Seven earned 250 total points
ID: 34146029
You can either index your original table

USE MyTable Exclusive
INDEX ON fld1 TAG fld1

Open in new window


OR you can sort as you select
Select * ;
from MyTable ;
order By fld1 Into Cursor cMycursor Readwrite

Open in new window


OR if you want multiple indexes in your result you would have to:
Select * ;
from MyTable ;
Into Cursor cMycursor Readwrite
INDEX ON fld1 TAG fld1
INDEX ON fld2 TAG fld2
...

Open in new window

Then set the index to whichever you want to use
SET ORDER TO fld1
...
SET ORDER TO fld2
....

Open in new window

0
 
LVL 12

Assisted Solution

by:jrbbldr
jrbbldr earned 250 total points
ID: 34146030
Select * ;
      from MyTable ;
      order By fld1, fld2 Into Cursor cMycursor Readwrite


Will create a Cursor.  
And that Cursor may be Ordered, but it has No Index on it
You need to create an Index on the Cursor after it is created.
Immediately after creating the Index it will be Active, but should you use the Cursor in a variety of ways, you will need to  SET ORDER TO <index tag>   to ensure that the particular index is Active

Good Luck


0
 
LVL 12

Expert Comment

by:jrbbldr
ID: 34146111
Also I have to agree with the comments of some of the other gurus (http://www.experts-exchange.com/Microsoft/Applications/FoxPro/Q_26612003.html) in the numerous posts you have entered on the wide variety of VFP issues that you have needed help with.     It seems as though we have needed to assist you almost line-by-line on this entire project of yours.

In light of the almost line-by-line assistance that you have needed it might be well worth your while to Hire a VFP consultant to tutor you personally or to assist you in your project.

Good Luck
0
 

Author Comment

by:jaymz69
ID: 34146631
Is that what this is not for?

Thanks again for all your input...
0
 
LVL 12

Expert Comment

by:jrbbldr
ID: 34147189
"Is that what this is not for?"

The forum is to provide assistance to users who need it from time-to-time, but when that level of assistance goes to the line-by-line for an entire project, it could easily be considered excessive and justifying your getting more detailed line-by-line assistance through a contracted professional.

If you look at your other positing which I referenced above you will see where other top-rated gurus for this site have made previous similar comments.

Good Luck
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Auto select alias in visual foxpro 6 163
VFP on Windows Server 2 386
Fox pro conversion 3 92
Powershell script to Recycle processes all at once ( cleanly) 15 54
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question