Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through Data Services
Message
From
18/08/2001 18:03:16
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00544329
Message ID:
00545909
Views:
22
>Mark,

>Sorry it took me a few days to reply to this message! If you're trying to bind a UI control to a business object that uses SQL pass through, set the business object's nRequeryType property to 5 (Requery on Init()). This ensures that the business object retrieves its data before the UI control tries to bind to its associated cursor (as long as you make sure the business object instantiates before the UI control).

Kevin,

As you suggested, I set the nRequeryType property to the 5th radio button (value 4) but this didn't help. In stead of the cFindform, I took a cbizobjform , dropped a bizobject and a grid on the form. With this configuration, I had no problems as long as the no data on load checkbox wasn’t checked. But even this doesn’t quite solve my problem: I chose SPT Data in stead of a remote view for better performance with complex queries and I want the user to be able to build the where clause himself. When the form initialises, the user hasn't got the opportunity to choose the query conditions, so how can the business object retrieve its data when it doesn’t know yet what data to retrieve? (By the way What does the ‘No Data on Load checkbox’ do in the context of SQL Pass Through?) I suppose I could initially make getsqlstring( ) return a string like ‘Select * from Products where price > 1 and price < 1’ resulting in an empty cursor but at least a cursor that the UI controls can bind to avoiding the ‘Invalid controlsource’ message.
If I’m correct, what is the most elegant way to do this so I can move my app to 3-tier later on without too much trouble (I suppose creating a Thisform.cSqlString property that is set to the above initialisation string isn’t a good idea.) ?
Possibly I’m missing the point. Can you help me?

Thank you in advance,

Mark


NB: I noticed a little problem with the SPT Data Access builder which I think is a bug: From the Business Object Builder (in the case of an bizobject that gets data from a SPT data environment), clicking on the descriptive name for the SQL pass through element (Data Access Object) and choosing the edit button, launches the Data Access Edit Form for SPT .
1) When there is already code in the getsqlstring method and the checkbox ‘no data on load’ is checked followed by clicking the OK button, saving changes and closing the MM BizObjbuilder, the contents of the getsqlstring is deleted. (the no-Default text disappears)
2) Checking the checkbox ‘Use parameterised views’ , saving and closing has no effect: after reopening the checkbox is still unchecked.
3)When I want to associate a Business Object to a SPT ‘environment’ that already exist (by selecting it in the combobox of the Business Object builder) and I click the edit button, the getsqlstring of the SPT data access object appears to be deleted.
(I've got version 6.1 that I downloaded on 06/07/2001)
If everything seems to be going well, you obviously don't know what the hell is going on !
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform