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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Type Mismatch on SELECT cursorname

Status
Not open for further replies.

kenndot

Programmer
May 15, 2001
316
0
0
US
Here's the code I have.

COUNT for fullrsn = reasdesc to ttlallvends
IF ttlallvends > 0
** some stuff happens here but it's never reached
ENDIF
eLSE

SELECT step1vendors
GO bottom
eNDIF

THE PROBLEM IS AT THE

SELECT STEP1VENDORS
It generates a "DATA TYPE MISMATCH" error, although if I suspend and step through that line again, it works fine.

Ideas?

It only generates the error one time. This code is hit several times and is successful after the first time it bombs.
 
Step1Vendors is a valid cursor that does contain records (characters).
 
Sorry, no idea why you are seeing this message here.

Just looking again at your code.. is the fact that you posted a COUNT statement relevant at all? Also, I assume that your IF, ELSE and ENDIF are all properly matched? They aren't in the extract you posted.

Mike


Mike Lewis
Edinburgh, Scotland
 
yeah, i noticed that, that was just when i cut and pasted it got all messed up, but it's correct in the code (i would get a nesting error if that were the case)

i've been experimenting w/the count because I had the same thought, but I haven't come up with anything yet. if anyone has any ideas, please keep them coming...

thanks mike
 
Maybe it's the GO BOTTOM rather than the SELECT statement. Is there perhaps a filter on STEP1VENDORS? Or maybe an index with an expression?

Mike Krausnick
Dublin, California
 
Do you have a relationship set somewhere that involves this table, or maybe a filter condition involving the table? I've seen this before and it can be caused by a broken relationship.
 
Ah, I think those last two posts are getting somewhere. If there is a filter on the alias, the filter expression will be evaluated at that point. If the expression contains a data type mismatch, that would explain why you are seeing that error.

Mike


Mike Lewis
Edinburgh, Scotland
 
Hello all.

No there is no filter on that cursor. Here's something new that I've encountered. It doesn't matter which table I try to select, and actually it bombs on ANY statement that follows, not just a SELECT statement.

I have even suspended the program, manually gone into the data session and picked that (and others, too) cursor and it still fails. It fails one time, then after that all is good.

I know it's terrible, but for the time being, because I am at my wits end, I have caught the error and am simply sending the focus right back to the point of error and it works fine. It's very strange and I've had a LOT of people take a look, but noone has been able to figure this out. I've copied and pasted the code into a new prg just in case something got corrupted somewhere? I have tried selecting the # associated with the table, but that doesn't matter because as I said, it's not the SELECT statement per say that is the problem, it's ANYTHING that I put in that particular spot.

Another thing... when I catch the error, I catch the error number with it, and although it's Error 9, the program doesn't seem to realize the error number in this instance. It sends a 0.

I will gladly take any other suggestions anyone may have.
 
kenndot,

Hmmm...given the fact that the error only happens once and then all is fine after that maybe try the following instead of your error trapping:

DOEVENTS
=INKEY(1) && give vfp a little breather...increase if necessary
SELECT step1vendors &&Now do your command

...this is only a guess, but given that any command blows up there but then VFP is fine maybe there is something going on that VFP needs to finish. You can play with the INKEY() value to make it wait longer or shorter and see if that does anything. DOEVENTS and INKEY() both may not be necessary but I thought I would include them both and then if it works you could try them separately and find out what works and what doesn't. Please post back and let me know if it had any effect at all, I am interested in what is going on with the error you are getting.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top