Rafael,
No, you don't need to do the fill() if you make the CA fetch all records (which 
is obviously a property).

I think we have it sorted now though. For some reason, we recreated the test 
form and subclessed CA's which we left as set up with an actual connection 
string so that we could test out the connections then in the Data Environment 
beforeOpenTebles() issued a small call to a routine that does a 
SQLStringConnect to the remote database and then sets the dataenvironment 
datasource to the handle returned back from the SQLStringConnect. Before you do 
this you have to enter the builder for the CA in the DE and select 
UseDEDatasSource for the CA to .T.

A lot of messing about, but it is now working fine, even sending updates and 
reverting data back.

Dave
 

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Rafael Copquin
Sent: 03 August 2015 13:46
To: [email protected]
Subject: Re: Cursor Adapter

Perhaps you need to put this code in the load event of the form:

thisform.dataenvironment.howeveryounamedyourca.cursorfill()

Rafael Copquin


El 03/08/2015 a las 7:38, Dave Crozier escribió:
> Fellow VFP Foxphiles, ladies and gentlemen, I normally do all my 
> Remote SQL through SQL Pasthrough but Tom here is branching out into Cursor 
> Adapters which I dabbled with just after VFP8 and just before VFP9 and 
> resorted to the SPT methods as the preferred method of accessing remote data.
>
> So, question as I know I have done it before but the old brain cells just 
> ain't functioning today!!
>
>
> 1.       Made up a subclassed cursoradapter for a table on SQL server - test 
> connectivity ... OK
>
> 2.       DataEnvironment on a form ... go into builder and add in the 
> subclassed CA above ... no problem
>
> 3.       Add grid on the form with recordsource set to cursor just created in 
> DE ... no problem
>
> 4.       Cursor set to fetch all records
>
> 5.       Open the form and no data pulled back from the remote source at all. 
> I have looked at the before fill(), fill() methods on the cursor as well as 
> the beforetableopen() in the DE and no data ever passes back to VFP. It is 
> just as though the cursor is set to open without data fill which I have 
> checked of course.
>
>
>
> Question:
>
> How to automatically retrieve the data into the CA....i am sure that 
> something pretty basic is not being done here but despite readiing Megafox, 
> 1001 things as well as the CA sections in what's new VFP8 and 9 I can't 
> figure it out but it is pretty basic of that I am sure.
>
>
>
> This is driving me totally mad now and I have tried attaching the CA to both 
> remote SQL sources as well as using the ODBC link back to a local VFP 
> database/table which gives exactly the same result.
>
>
>
> I know I can do the whole process programmatically using either SPT or CA's 
> as I have done both but it would be preferable to use the subclassed CA's in 
> the DE in exactly the same way you use native tables.
>
>
>
> Dave
>
>
> --- StripMime Report -- processed MIME parts --- multipart/alternative
>    text/plain (text body -- kept)
>    text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to