Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seek and LOCATE FOR not returning row
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Seek and LOCATE FOR not returning row
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01658236
Message ID:
01658236
Views:
41
I'm thinking the problem may be in using varchar and inconsistent length for the index. I probably try to change index expression to use cast to char and do the same changes in the code and see if it helps.

UPDATE. Changing index to use PADR seems to help.

------------------------------------------------------
Hi everybody,

I don't understand this problem. I can see the row is in my cursor. However, both seek and locate for are failing to find this row.

Here is what I'm trying in the command window:
LOCATE FOR templateName = 'APPAREL' AND Value_name= 'Female'
=MESSAGEBOX(value_name)
and I see result as 'LGE'

I'm attaching both structure and the data in the cursor. Can someone please explain this problem to me? I tried with SET EXACT ON and OFF - no difference :(

The actual code in the form is
*              INDEX on TemplateName + ' ' + cType + ' ' + Value_Name TAG TmplValue

					if not seek(upper(csrItems.MatrixTemplate) + ' ' + 'Row ' + alltrim(csrMatrix_Items.MatrixRowValue), 'csrTemplate','TmplValue')
					    SET STEP ON
Why is it failing?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform