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

use in designer newly added columns to a remote view as a column recordsource

Status
Not open for further replies.

janos.lazar

Programmer
Oct 13, 2018
2
HU
Hi all,
I use Visual Foxpro 9.0, SP2 for a while.
I have to use it for maintaining a program that is developed in VFP 9.0., and a VFP database container.
The Database Container contains remote views to tables of an Access database (.mdb).
I added some new columns to a table in the Access database. Then I also added these columns to the remote view in the '.dbc' file. When i did so, i could choose the newly added colunmns into the "selected columns list" without any problem. I also checked that the columns have the same update settings as others have.
I want to use these new columns in an existing grid on a form. I added new columns to the grid, by setting the grid's ColumnCount property in the designer.
My problem is, when I open the form in the designer, and i'm trying to set the new columns' controlsource, I can't choose the newly added columns of the remote view from the dropdown list of the 'Properties' tab,neither can i see them in the Expression Builder window as choosable fields.
I feel like if the designer disregarded that the '.dbc' file had been changed.
The name of the '.dbc' file has remained the same, the name of the remote view also, it just has been added some new columns.
Please answer the following question:

How can I tell the designer to refresh the grid's recordsource to the changed remote view in the changed '.dbc', so that the newly added columns can be choosen as a controlsource for the grid's columns?

I noticed that when i run the compiled exe and i open the form i get the following error message:
'Error loading file - record number 73. (grid name here) <or one of its members>. ControlSource : Variable '(the name of a newly added column of the remote view stands here)' is not found'

Thank you for your help
janos.lazar
 
This sounds like the form may reference another DBC in its data environment. It's not unusual you would develop with a DBC in your project and not work on and with the DBC shared with all users. No matter if VFP DBFs remote view DBC which backend remote views connect to, you likely will also not work on the production Access data and have your devlopement mdb.

So if you already made the change in the production databases you're going one step ahead and forgot to do all this in development or test data first.

If that's not the problem I don't know, then thinking about such a setup would be useful, though it's not your topic and problem right now.

Restarting VFP should help because indeed the property window will show the list of remote view fields once the form data environment is set up and has the view and the grid has that view as its recordsource.

When the project already contains things, which hint on using the FFC classes and wizards and builders, i.e. when the project contains references to classes from the VFP Home())+"Wizards" and "FFC" folders like wiz*.vcx libraries, you can also be quite sure the grid has been defined by the default grid builder, then right click on the grid, pick "Builder" and see whether you see these new fields there. If the project is not yet including references to that, I'd rather look out whats the basis of this project. When it's done with a framework you should also use its tools, wizards, builders and such to change. No worries, you are always able to modify things with native FoxPro tools like the property window directly, I don't know any framework, which would disallow that, but once a project makes use of a framework and you start working the native way you may miss some tools and maintenance of meta data that changes things both at run and design time.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi Olaf,

Your assumption was right. I checked the Data Environment of the form, and the properties of the cursor in it. It turned out that the cursor's Database property still pointed to the old '.DBC' file.
The reason of that is, there is a separate folder for the application and it's accessories that is usually present on the clients' computer for running, and the development uses another directory. I copied the changed database files to the "running folder", but I missed to copy them into the "development folder" also.
As soon as I copied the changed database files to the "development folder", the designer accessed the new fields.

Thank you for your useful answer,

janos.lazar
 
OK, since you're new in all this such things can happen. Now you know, the next change should obviously be first done in the development folder and then released, once its tested.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top