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

File Does Not Exist Error 1

Status
Not open for further replies.

JeffH

MIS
Jul 13, 2001
14
0
0
US
Hopefully this one is easy...

I created a ListBox and would like to set the RowSource to a query. I set the RowSourceType property to Query .QPR, and the RowSource property has the full path to the .qpr file. When I try to run the form, I get the following error:

File '<file name>' does not exist

I've tried different variations (using 8.3 compliant path, encapsalating in quotes, etc...) but nothing seems to work (actually, putting the path in quotes *sometimes* works, but sometimes it trashes my form and I have to delete it and start again--I'm getting pretty darn good at creating a listbox on the form).

Other pieces of info that might be useful:

VFP 6.0 SP5
Query is an inner-join with 2 tables and outputting to a cursor
VFP Experience of developer--N/A

Thanks,

Jeff
 
Hi Jeff,

You are doing correct.
Just try the following also.

When you click on the rowsource property of list box, there is an elippse button (...) on the right hand side, which allow you to browse through the machine to select a query.
Try to select your query file from there. (You must be having your query file as extension .QPR)
And then run your form.


If it does not work try this.
Set the rowsource type property as alias
don't put any alias in rowsource property.
In the init procedure of your form, run the query and store the results in a cursor.
assign this new cursor to the rowsource property of list like : THISFORM.myList.ROWSOURCE='myCursor'


Hope this works.



 
Thanks, I got it working with your second idea (browsing for file yielded same error)! I'm still puzzled though,

Here is my code (init proc on form):

do qlkpschclass.qpr
THISFORM.lstClassList.ROWSOURCE='curClassLst'

This gives me the same error

but this works:

do D:\VFPPRJCT\DATA\qlkpschclass.qpr
THISFORM.lstClassList.ROWSOURCE='curClassLst'

If the query is part of the project, shouldn't I be able to reference it by a relative path instead of an absolute one (or ideally, just the file name)?

What's going to happen when I create an .exe and all the files are stored in the C:\VFP PROGRAM directroy on the client computers, will this fail? Do I have to change all the code in my forms? As you can tell I'm a little new to VFP...

Should I develop in the same directory structure that the application will run in?

Thanks again for the help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top