Rafael, Are you using Windows or SQL Server Authentication? How are you connecting to the SQL Server data in the main form?
Currently I am trying out with the master data which seems to be working. Can you send me an example of building CA in code. Currently I have saved a class for each table that I am working with. Thanks Ajoy Khaund akha...@hotmail.com -------------------------------------------------- From: "Rafael Copquin" <rcopq...@fibertel.com.ar> Sent: Wednesday, October 12, 2011 7:46 PM To: <profoxt...@leafe.com> Subject: Re: Cursor Adapter in DE Question > Running the risk of overkill in this matter, I use CA's assiduously in > all my apps, but always in code, not the wizard. Even in client/server > situations, CA's are great, simply because you can insert, delete or > modify your CA cursor as any regular VFP cursor and then, with a simple > tableupdate you get the underlying tables updated. With SPT you have to > code with the slight modifications demanded by T-SQL, which in some > cases is different from VFP syntax. A bit of extra work and care. > > I developed a series of classes that build CA's in code by simply > passing parameters to the class and coding is much faster that way. > > In any case, you can use a combination of SPT and CA's in the same > routine and both will work just as well. I guess it is a matter of > choice or oportunity. > > Rafael Copquin > > > El 12/10/2011 4:17, Dave Crozier escribió: >> Rafael, >> Well that is the way I normally do things i.e entirely in code and using >> SPT but I thought I'd just take a dip in to see if it would save time.... >> Seemingly not, so I'll just recode everything using my normal Data Access >> Components... >> >> Thanks for the reply. As they say, if we don't try these new things we'll >> never know how good or bad they are. >> >> Dave >> >> >> -----Original Message----- >> From: profox-boun...@leafe.com [mailto:profox-boun...@leafe.com] On >> Behalf Of Rafael Copquin >> Sent: 11 October 2011 17:07 >> To: profox@leafe.com >> Subject: Re: Cursor Adapter in DE Question >> >> It is a better way of doing things, to do your CA's in code and not in >> the DE. You have greater control, especially if your select statement >> involves more than one table. If you use the DE CA you would have to >> change the select statement manually, because the wizard can only create >> a select of just one table efficiently ( I mean, adding the joins >> properly) >> >> Another thing you might consider, is not to use relations at all but sql >> select statements to get the child table, based on the primary key of >> the father table that has a correspondence in the child table as a >> foreign key. IOW, get the primary key of the record in the father table, >> then issue a select statement to get the child records based on that key >> which should be the foreign key in the child. >> >> ie nPK = fathertable.pkfield >> >> select * from childtable where foreingkeyfield = nPK >> >> So every time you refresh your CA (you can use requery(), just like a >> view ), get the PK of the record you just obtained, and use a select >> statement as above to get your child records. >> >> BTW, your child could be another CA or just a non-CA cursor, as you >> explained >> >> The other thing that comes to mind is that the only way I find CA's >> benefitial in a situation as the one you describe is when you need to >> update the underlying table, otherwise, simple SPT statements would do >> just fine. >> >> Rafael Copquin >> >> >> El 11/10/2011 12:41, Dave Crozier escribió: >>> Not having used cursor adapters very much and wanting to try them as a >>> short cut to make the conversion of a suite of programs into "Client >>> server" I have the following Question. >>> >>> I have a parent table which I can pick up in the cursoradapter modifying >>> the "SelectCmd property and then issuing a CursorFill method no problem, >>> the parent table refreshes itself OK and reflecs this in the form. >>> >>> However, when I add a child table that is NOT a cursor adapter but a VFP >>> table and then set up the relationship in the DE as you would with >>> standard VFP tables using a dragged link between the parent and child, >>> then when I "Refill" the parent table, the child doesn't reposition >>> itself as per the relationship. Its just as though the relationship >>> needs to be refreshed, but you can't refresh a relationship!!! >>> >>> >>> Any Ideas.... this is driving me mad and I wish I'd stayed with SPT >>> throughout, but using adapters would save so much recoding... >>> >>> >>> Dave C >>> >>> [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/E3756158ACD146539FB50A18CE0570FC@ajoykcompaq ** 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.