Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: prasanna kunder
  Where is prasanna kunder?
 mumbai
 India
 prasanna kunder
 Tags
Subject: RE: mysql(7)
Thread ID: 373378 Message ID: 373398 # Views: 51 # Ratings: 1
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, March 21, 2013 11:51:03 PM         
   


> Hi experts
>
> i am using
>
>
SET MULTILOCKS ON
> PUBLIC lodo
> lodo = CreateObject("CursorAdapter")
> lodo.DataSourceType="ODBC"
> lodo.DataSource=SQLStringConnect("DRIVER={MySQL ODBC 5.2(w) Driver};SERVER=192.168.0.52;database=maxell_Data;uid=root;pwd=pmk007")
> lodo.alias = "cInfo_SQL"
> lodo.SelectCmd="select * from Info"
> lodo.CursorFill()
> 
> lodo.TABLES='InFo'
> lodo.KEYFIELDLIST='IdInfo'
> lodo.UPDATABLEFIELDLIST='AccCode,AccCode,AccHead,UnderCode,GroupCode,FullCode'
> lodo.UPDATENAMELIST = "IdInFo InFo.IDInfo ,;
> 					   AccCode Info.AccCode,;
> 					   AccHead Info.AccHead,;
> 					   UnderCode Info.UnderCode,;
> 					   GroupCode Info.GroupCode,;
> 					   FullCode Info.FullCode" 
> 

> now i want open another table in same database
> so i can use like this
>
> lodo.alias = "cCustomer"
> lodo.SelectCmd="select * from Customer"
> lodo.CursorFill()
> ....
>
> then i can use both alias so i can make TABLEUPDATE(.T.,.T.)
>
> i am new in mysql, CA
>
> thanks in advance


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

ENTIRE THREAD

mysql(7) Posted by prasanna kunder @ 3/21/2013 7:58:37 PM
RE: mysql(7) Posted by Stefan Wuebbe @ 3/21/2013 11:51:03 PM
RE: mysql(7) Posted by prasanna kunder @ 3/22/2013 6:43:14 AM
RE: mysql(7) Posted by prasanna kunder @ 3/22/2013 6:50:40 AM
RE: mysql(7) Posted by Stefan Wuebbe @ 3/22/2013 7:26:13 AM
RE: mysql(7) Posted by prasanna kunder @ 3/22/2013 3:03:29 PM
RE: mysql(7) Posted by Stefan Wuebbe @ 3/22/2013 4:00:32 PM
RE: mysql(7) Posted by prasanna kunder @ 3/22/2013 5:36:11 PM
RE: mysql(7) Posted by Om Rajan @ 3/22/2013 7:50:28 PM