Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with select statement

Status
Not open for further replies.

josedeman

Programmer
Jan 20, 2004
23
NL
I have a client that has the following configuration:
Citrix server
Windows 2003
VFP 7 SP1 application

When I issued a select statement the resultset is empty. That surprised me because I knew there had to be records that matched the select statement. When I issue the same select statement a while later I do get results back.
Sometimes it takes two tries, sometimes three.
Does anyone have a clue?
 

Can you post the code so we can see where the problem might be?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Is it possible that the data that you knew matched the result set had just been edited, and was still being buffered? In general, a SELECT statement works against a physical disk file, and ignores any buffered data.

If that's not the case, you will have to give us more details, including the code that is causing the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Here's the code:

IF USED('indiavfu')
SELECT indiavfu
ELSE
USE indiavfu
ENDIF

Select *;
from indiavfu;
where Upper(indiavfu.Clientnr+indiavfu.Indicnr) == Upper(lcClientnr+lcIndicnr);
into Cursor aanvrfunc

I've checked the values of lcClientnr and lcIndicnr and they are correct.
 
I'm sure I'm using the same indiavfu every time.
No buffering either of table indiavfu, nowhere in the application.
What's even stranger: I removed one of the records in indiavfu and use the same select statement and it gave back the row I had just deleted. (That happened just once, I can't reproduce this)
I'm at a complete loss
 
I'm sure I'm using the same indiavfu
I don't want to nag but I've said the same thing myself many times - Fox never listens to what I say and carries on working with the wrong table. Have you actually tested with dbf() that the right table is being used?

I removed one of the records in indiavfu and use the same select statement and it gave back the row I had just deleted.
This really does sound as though you are deleting from one table and selecting from another.

Geoff Franklin
 
Josedeman,

Code:
where Upper(indiavfu.Clientnr+indiavfu.Indicnr) == Upper(lcClientnr+lcIndicnr);

Is it possible that the length of lcClientnr is different from that of indiavfu.Clientnr? Perhaps you need to do an ALLTRIM() before you concanate. Something like this:

Code:
where Upper(alltrim(indiavfu.Clientnr)+alltrim(indiavfu.Indicnr)) == Upper(alltrim(lcClientnr)+alltrim(lcIndicnr)};

Just a thought.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
I've re-checked the dbf() and it was the correct one...
The lenth of both lcclientnr and lcindicnr are correct

I've been reading on the internet about problems with windows 2003 and foxpro databases / .NET. Could this be related?
 

What's even stranger: I removed one of the records in indiavfu and use the same select statement and it gave back the row I had just deleted. (That happened just once, I can't reproduce this)

Was, by any chance, SET DELETED reset from OFF to ON after the first time?

 
Josedeman,

I've been reading on the internet about problems with windows 2003 and foxpro databases / .NET. Could this be related?

It would be much easier to answer that if you could tell us exactly what these problems are.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
I've been reading on the internet about problems with windows 2003 and foxpro databases / .NET
There's a lot of ill-informed comment on the Net about problems with Foxpro. Usually complaints like "Foxpro can't ..." from people who've never used the product or who think it was dropped after Fox 2.6.

I'm happily running VFP 8 with Win 2003 sharing files between local and Terminal Server users. What problems have you been reading about?

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top