Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicForeColor and Font problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00302451
Message ID:
00302687
Views:
27
>>>I use three stored procedures to return DynamicForeColor, BackColor, and FontSize to columns in a grid. The procedures work fine in the development environment. Running the .exe returns "Expression is invalid. Use a valid expression for DYNAMICFORECOLOR" and so on for each of the property settings in each column. If I run the .exe from the command window it works fine too, but not standalone.
>>>
>>>Any ideas?
>>>
>>>Al Allison
>>
>>When you include a database in a project, that database is opened and set to current when the project is open. At runtime, the database might not be set to the current database when your grid is instanciated, so the SP might not be in scope. You need to have code in the form.load event that opens the database and set it rto the current database with SET DATABASE. Better yet, rethink the location of this code- if the code is form specific, why not put it in a custom form method? If the same code is run from several forms, you can subclass your grid, and put the code in a custom grid method.
>
>Thanks for the reply Eric,
>
>I did have the code in custom form methods, for the reasons you mention. It was not till I ran the .exe free standing that I was aware of the problem. The .exe has a different name, so I can close clear and release everything and run it from the command window, or run it on first entry to VFP6, when I know there is nothing open, and it runs fine. It would not run free-standing without the error. Since some of the code in the methods references fields in the tables, I tried moving it to the stored procedures to see if it would make any difference, thinking the tables would be opened and the stored procedures available before the form runs. The grid is on the second page of a page frame. The form loads and I have a good record on the first page, I can add a record from there and get a new key, which is a stored procedure too, but as soon as I click the second page tab I get the error, and this is only on the free-standing .exe
>
>Could I have left somethihng out of the setup wizard build? Do I have to do a specific compile for the changes in the stored procedures? I will try an explicit open database and set database in the form load asnd see if that helps.
>


Again, SET DATABASE
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform