Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.

  Osis Barajas
  Where is Osis Barajas?
 Osis Barajas

if this information it's helpful yet...

Avoiding a VFP CursorAdapter Builder Error
If you create a form that contains a CursorAdapter that accesses remote data in the Data Environment, you might find that when you run the form the CursorAdapter cursor is not created. This can occur if you allow the Visual FoxPro CursorAdapter Builder to put code into the CursorAdapter cursor object’s Init event. (The CursorAdapter Builder also puts code into the AutoOpen event).
The problem is that the CursorAdapter Builder leaves out one important line of code - the line that places a connection handle in the DataSource property of the CursorAdapter. Without the connection handle in the DataSource property, the remote data cannot be accessed and the cursor cannot be created.

If you look at the Init code of a CursorAdapter class that you create through the VPME Data Builder, you will see that the line in question is there (This.DataSource = ...). However, when the Visual FoxPro CursorAdapter Builder inserts Init code into a CursorAdapter’s cursor object, it blocks the correct Init code in the CursorAdapter class from being executed.
Since the correct code already exists in the CursorAdapter class, the solution to this problem is to not allow the VFP CursorAdapter Builder to put the problem code into the CursorAdapter cursor for a form. The Init and AutoOpen code is not needed in the cursor object because the code from the class will be used if none exists in the cursor (remember inheritance?).
Therfore, if you find code in the Init and AutoOpen events of a CursorAdapter cursor in the Data Environment of a form, remove it.

Tip – Don’t Let the VFP CursorAdapter Builder Add Code: When you are in the process of adding a CursorAdapter to the Data Environment of a form using the Data Environment Builder, you must prevent the CursorAdapter Builder from putting code in the CursorAdapter's events. You can prevent the VFP CursorAdapter Builder from adding code by clicking the Cancel button whenever the CursorAdapter Builder is displayed. If you click the OK button instead, code will be added to the CursorAdapter's events, even if you do not make any changes to the CursorAdapter through the VFP CursorAdapter Builder.
Remember, if you end up with code in a CursorAdapter cursor’s Init and AutoOpen events, you can simply remove it. Just make sure that the events are completely empty. They cannot even contain comments or spaces. Alternatively, if for some reason you need to leave the code in the Init event, you can simply add the missing line of code where it belongs (check the CursorAdapter class to see exactly where it goes).


Grace lyn asok @ 2/10/2009 8:35:28 AM
hello good job!!!!!!!!!!!1111

PEDRO J gonzal;ez @ 12/8/2014 8:53:19 PM
PO box 380160 bklyn ny 11238 www re domain.pedro-gonzalez.net foxtice lap topIBM pc ceil phone iphones call mail po box 380160 bklyn ny 11238

MR GONZALEZ @ 1/23/2015 7:33:42 PM
NEED YOU IN NEW YORK for TRANING as PROGROM boss big hotel call back 3472483996 4:00pm

Amin Tavazo @ 4/25/2015 6:37:59 AM
Hi, Tanks

MR GONZALEZ @ 5/17/2015 11:42:16 PM
loans homes program opperation apts for business mangersmangerment.com ibf agents brokers fdic bankers caver fed union banker bklyn for more programing thankyou

PEDRO J GONZALEZ @ 6/29/2016 6:52:13 PM

Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: