Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 To: Benny Thomas
  Where is Benny Thomas?
 Jeddah
 Saudi Arabia
 Benny Thomas
 Tags
Subject: RE: CA Tutorial Part II
Thread ID: 209695 Message ID: 209769 # Views: 6 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, December 31, 2008 5:34:25 AM         
   


Benny

> Hi Bernard,
>
> Thank you for the time spared to check the uploaded files. As suggested by you I have deleted all class and forms made earlier in this regard. In the VFP command box entered the following :
>
>
>
> oConn = SQLSTRINGCONNECT([Driver={SQL Server};Server=benny\sqlexpress;Database=Northwind;Trusted_connection=yes;])
> ? oConn		&& returns 1 - connection successful
> 

>
> Then I put a print out of your CA Tutorial Part II in front of me and followed everything line by line. I created a new class caBaseClass, ticked Use DataEnvironment data source (which I missed in my earlier class), added the extra codes for the global connection in INIT() (also not done in my previous work) and saved the class. Created a new sub-class called caOrders from the baseclass and followed each instruction to save the class. Then created a test form as detailed in the tutorial. But while running the form I get the following error (same as I got earlier).
>
>
> I am uploding the class and the form - kindly check it.
>
> Regards,
>
> Benny
>
>
> https://www.foxite.com/uploads/7c11975e-239d-4ebc-9656-505369cde989.rar

This is very embarrassing. By your own admission you missed two vital; points. The new error is because you are still not following the tutorial correctly. Here is a screen dump of your caorders and mine I created from the tutorial.
Your Class


and here is mine. Notice any difference?


Why is there a difference? Because you did not follow the tutorial correctly. The difference is due to this step that you did not follow:
Your Class - where is your datasource?


My Class as per the tutorial - look there is oconn used.


Which step did you not follow? Why this one here from the tutorial:


As you can see you are just missing steps like you did earlier. Why this is I just don;t know, but that is something you need to sort out with yourself.

Anyway here is the class and form that I created by following the tutorial. It took me just 2 minutes and worked first time because I did not miss any step. Download it, then set up oconn from the command prompt and run the form. Change some value and move to another record.

https://www.foxite.com/uploads/608ab75c-2fb7-4574-a778-462a5dfaf351.zip

Close and re run the form and see that your changes have been saved with no extra code at all. That is the magic of the CA.

If you can create a workable class by yourself, then run it in TRACE mode and single step to see what is going on.


Bernard

** If you see someone without a smile, give em one of yours :) **
My Blog 8-)

ENTIRE THREAD

CA Tutorial Part II Posted by Benny Thomas @ 12/30/2008 2:26:06 PM
RE: CA Tutorial Part II Posted by Bernard Bout @ 12/31/2008 5:34:25 AM
RE: CA Tutorial Part II Posted by Benny Thomas @ 12/31/2008 8:58:38 AM
RE: CA Tutorial Part II Posted by Bernard Bout @ 1/2/2009 3:33:45 AM
RE: CA Tutorial Part II Posted by Benny Thomas @ 1/3/2009 10:02:50 AM
RE: CA Tutorial Part II Posted by Bernard Bout @ 1/3/2009 4:39:19 PM
RE: CA Tutorial Part II Posted by Benny Thomas @ 1/4/2009 9:20:46 AM
RE: CA Tutorial Part II Posted by Bernard Bout @ 1/5/2009 4:21:35 AM
RE: CA Tutorial Part II Posted by Benny Thomas @ 1/5/2009 7:48:32 AM
RE: CA Tutorial Part II Posted by Bernard Bout @ 1/5/2009 3:41:32 PM
RE: CA Tutorial Part II Posted by Benny Thomas @ 1/5/2009 6:36:37 PM