From: Stefan Wuebbe
To: prasanna kunder
Visual FoxPro 9
Databases, Tables and SQL Server
Friday, March 22, 2013 7:26:13 AM
This message was rated by:
> > If I got the question right, it might be easier to create persistent reusable custom classes in the Class Designer (or by using "Define Class" syntax in a PRG if you prefer that one).
> > So that afterwards you can create instance(s) of your "customerCursorAdpater" class wherever you want, as well as instance(s) of your "infoCursorAdapter" class, as many as you need, for example one for each Form (class).
> > In other words, you would not use one object but many, and the objects would not need to be Public because you can NewObject() or AddObject() them where you need them, say as a member of a custom myDataEnvironment class or so.
> > That way your code would become sparse and easy, no need to set a bunch of properties at run-time dynamically
> > hth
> > -Stefan
> if i want use more then one CA
> then how can i use
> give some example
> thanks in advance
How would you describe the problem you are currently having, is it about using classes in general?
As a nutshell description of how I'd do it:
I'd start by creating a custom "base" class in a VCX, similar to what Cetin posted here called "caGeneric".
That class would look relatively complex at first glance, and actually is a master piece.
But it's "generic", hence reusable, so that complexity would not matter at all, your advantage would be the "reusability":
You'd probably create another class based on the first according to your particular requirements, say decide whether it's using ODBC or ADO and what back-end make and model, or "native" DBFs
Then you would create your concrete classes based on the second:
There you would determine the From table name, perhaps the field list, that's all, perhaps only two or three porperties (because the sophisticated base class is doing all the work for you).
Then you can drag&drop the concrete classes wherever you need it, for example on a custom myDataEnvironment class that can contain one, two or more CA instances, each being dedicated to a "topic", like "info", "customers", "Invoices" whatever.
There are alternate approaches, like the one that Bernard Bout describes in the Foxite -> Home -> Articles section.
Does that help?
Posted by prasanna kunder @ 3/21/2013 7:58:37 PM
Posted by Stefan Wuebbe @ 3/21/2013 11:51:03 PM
Posted by prasanna kunder @ 3/22/2013 6:43:14 AM
Posted by prasanna kunder @ 3/22/2013 6:50:40 AM
Posted by Stefan Wuebbe @ 3/22/2013 7:26:13 AM
Posted by prasanna kunder @ 3/22/2013 3:03:29 PM
Posted by Stefan Wuebbe @ 3/22/2013 4:00:32 PM
Posted by prasanna kunder @ 3/22/2013 5:36:11 PM
Posted by Om Rajan @ 3/22/2013 7:50:28 PM