Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View definition has been changed
Message
From
12/11/2001 11:01:46
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00580354
Message ID:
00580495
Views:
14
Vlad,

Thanks for the help. I'm about to try it. I know that views should maintain the same field widths but what about numeric field widths? What if the value of qty is 2 the first time the view is run and then 10 when it is requeried? Does this cause an error saying the view has changed?

Thanks.

>Hi!
>
>VAL(STR(0))
>
>Sometimes STR() can return "0" and sometimes "0.00". VAL() then produce different field types. This difference sometimes cause the error, because View field definition in database is different then the result of the view query. When you open database, database is updated automatically by a new structure of the view (that can cause conflicts in multi-user anvironment and should be *very* strongly avoided).
>
>Change it to the val(STR(0,2,0)), though I do not see reasons to use val(str()) - just specify "0 AS qty", unless VAL() return different result.
>
>HTH.
>
>>My form runs this view first and works every time:
>>
>>
>>SELECT Btstorge.store_type, Btstorge.location, SPACE(8) AS co_id,;
>> SPACE(5) AS info_type, CTOD("12/12/12") AS finan_dt, Btstorge.max,;
>> Btstorge.nbr_boxes, Btstorge.user_id, Btstorge.added, Btstorge.modified;
>> FROM bt!Storage Btstorge;
>> WHERE Btstorge.store_type = "B";
>> AND Btstorge.nbr_boxes = 0
>>
>>
>>Immediately after, it runs this view and often gives me the error View definition has been changed, but not all the time:
>>
>>SELECT Btstorge.store_type, Btstorge.location, SPACE(5) AS info_type,;
>> CTOD("12/12/12") AS finan_dt, Btstorge.nbr_boxes, Btstorge.max,;
>> VAL(STR(0)) AS qty;
>> FROM bt!Storage Btstorge;
>> WHERE Btstorge.store_type = "S";
>> AND Btstorge.max > Btstorge.nbr_boxes;
>> ORDER BY Btstorge.location
>>
>>
>>I found that if I put Open Database BT before the problem view, it works each time. Can anyone give me a clue as to what in the second view is different that would cause this issue and why the first one always works?
>>
>>Thanks!
>>
>>Sally
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform