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

Views-stopped working

Status
Not open for further replies.

rgw

Technical User
Sep 14, 2000
70
US
I've been rewriting an application to make greater use of views and so far so good until this morning. I'm working in vfp8 and have the user prompt for a value which then gets queried and shown in a grid on the form. This worked fine last night and when I ran the form this morning I get an error loading the form concerning the de.

I went back to views 101 and wrote the simplest of views to ask the database to bring me back a result based on an input parameter. Say I want the zip code '07060' and tell it to find it thru a parameter identified as m.zip with the ? infront. If I do it in vfp6 on another machine it works as you would expect. On the notebook in vfp8 it now tells me the sql column does not exist (it seems to think that m.zip refers to a column--doesn't matter if i change the name of the variable).

Obviously I'm doing or not doing something stupid here. Would appreciate any ideas.





 
Rgw,

I noticed something similar recently.

VFP 8.0 seems to be much fussier in what you put in the Example column in the view designer. My first thought would be to leave out the "m.". That shouldn't affect the functionality, but it might placate the view designer.

If that doesn't work, take a look at the generated SQL code. If you don't see anything obviously wrong with it, post the code here.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike:

Thank you for confirming i haven't totally lost it. vfp is a fun product but it does drive me nuts at times. How it can work many times and then blow up without making a change is beyond me.

The code of the generated sql is: (leaving out all the later dbset stuff):

SELECT Zip.zip, Zip.town, Zip.state;
FROM refund_8!zip;
WHERE Zip.zip = ?m.zip

all very basic: the error message is 'index does not accept null'

if i put a space between the '?' and the m.zip i get an error message of 'missing operand'

Of course, if I put a hard coded '07060' as the zip in the example box it works as you would expect. Very nice but totally useless in the program.

As I said before, it makes no use if i give the variable a name far apart from the queried field--m.trouble for example gives the same result as m.zip.

many thanks

 
mike:

forgot to tell you it makes no difference if you drop the 'm.'--it still gives you the same error messages.

rgw
 
Mike:

Thought you might like to know that the problem has been solved--for now--by the power of the magic reboot.

It takes the expected prompt--?m.zip and gives me back the proper result set.

Can't say it gives me much confidence in the product. Don't know whether it's some form of bug or just the combination of a Dell Latitude 800 running Windows 2000 with lots of memory and vfp8.

as it has happened to you the former is more likely. Do you know the best way of getting this info over to the vfp people at Microsoft?

rgw
 
Rgw,

No, that isn't a bug -- although I don't blame you for being frustrated by what appears to be totally inconsistent behaviour.

The reason it worked after a reboot is as follows. At some point in your experimentation, you did something invalid in the view designer. You then ran the view. VFP opened the cursor and either displayed some results or an error message. You then went back to the view designer to try to fix the problem. You then saved the modified view and closed the view designer.

Next, you quite reasonably attempted to do something with the view -- browse it, perhaps. What you didn't realise was that the original cursor was still open. So you were seeing the same results as before you modified the view. Just because you want into the view designer and made some changes doesn't mean that the original cursor got closed.

Of course, after the reboot, all was well. But you could have avoided the reboot just by doing CLOSE ALL immediately after closing the view designer.

Don't worry. These things get much easier after the first five years <g>.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top