Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a remote view that joins 3 tables. Having troub
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00095690
Message ID:
00098083
Views:
26
Do I have to set the view properties each time I use it or can they be set in the DBC? The reason I ask is I have tried using CURSORSETPROP() with the view open in the DBC and have not been able to get the settings to hold. The next time I use the view the settings are lost.

Thanks for any help.


>>I am using VFP 5.0 as my client and SYBASE SQL Anywhere 5.5.04 as my ODBC data source.
>>
>>I have an Inventory file that has foreign keys to Department and Brand records. I want to have in my view the names associated with these foreign keys so that the name can be displayed easily.
>>
>>This is my statement to create the remote view:
>>
>>create sql view v_inventory remote connection prototype as ;
>>SELECT StockInventory.INV_ScanCode,Brands.BRD_Name,;
>> Departments.DPT_Name;
>> FROM dba.StockInventory StockInventory ;
>> LEFT OUTER JOIN dba.Departments Departments ;
>> ON StockInventory.INV_DPT_FK = Departments.DPT_PK ;
>> LEFT OUTER JOIN dba.Brands Brands ;
>> ON Brands.BRD_PK = StockInventory.INV_BRD_FK
>>
>>VFP looks as though it has created the view, but if you attempt to modify the view you get the message "SQL: Cannot locate table". Then when viewing the view the third table in the SELECT is not there. It does not matter how I arrange the joins it is always missing the third table.
>>
>>The SELECT statement part of this statement works fine if I run it through SYBASE ISQL.
>>
>>I do have an ODBC trace of this. The one interesting thing that I notice right away is that there is not a SELECT statement for third table. There is a SELECT statement that matches the one sent then there are SELECT statements for StockInventory and Departments in this case.
>>
>>If anyone has any suggestions they sure would be appreciated.
>
>Steve, it may be connected to the fact, that VFP View Designer has a bug, which messes up views with one-to-many joins. You are still able to create the view programmatically, but you also have to set up the view properties only programmatically and not try to open it in the View Designer.
>I have a couple of views of that kind and even added "Not to open in the View Designer!!!" into the view description. :)
>
>HTH,
>Nick
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform