Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wierd error on requery() remote view
Message
 
 
To
28/07/1999 17:30:11
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00247419
Message ID:
00247502
Views:
20
>It took some effort to solve the problem I had yesterday, but it seems to have created a new problem. When I call requery('military') after an update or when skipping a record in the master table (master 1:1 military)I now get the error "base tables on the view have changed, unable to load view properties" The base tables have NOT changed scince the Upsizing Wizard sent them to Oracle. If I make a modifation and save the three affected views the calling form will work fine, once. When I re-run the form, the error happens again.
>I need to do the requery() calls in order to enforce the filter on the three(actauly 5, but two work fine) views so they and thier children will show on the second page of a pageframe.
>Any ideas how to fix this?

This has happened to me before, just 2 nights ago in fact. What happens if you have NoDataOnLoad = .t. is VFP will create the view structure based on erroneously calculated field width info. When you do a requery, all the matching records are retrieved as well as the structure needed to hold the data.

How this happened to me was I was retrieving a customer field which was a concatenation of the first and last name fields using the trim() function. The field width created was less than needed by the requery. So I padded the field with the number of spaces needed in my view definition. Example:

Problem Code:

select ... (trim(FirstName) + space(1) + LastName) as Customer ...

Good Code:

select ... (padr(trim(FirstName) + space(1) + LastName, 30, " ") as Customer ...

This forced VFP to define a field width of 30. When I did the NoDataOnLoad, the first matching customer record had no first and last name, only a business name. The width of the Lastname field was 20, so VFP created a Customer field with a width less than 30. When I issued a requery, the first matching record did have a first and last name whose width was more than the initial width.

One of these days, I will be more exact in how this happens and compose a FAQ.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform