Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-Steps error in ADO
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00525714
Message ID:
00526941
Views:
21
<<
The problem is when i try to assign the generated id from sql server inside my local recordset.
<<

Typically, auto-generate ID fields are read-only. If the XML you return has the ID, you should be able to get that data. i.e., if you try to stuff the data after creating the recordset, you will run into problems. Make the id part of the query string that gets returned. If this requires refreshing/re-fabricating a new recordset, so be it..


>VFP is not a good languaje in the Pointer/COM arena. The big problem is when this try to realese the object. For example
>
>Local oRecordSet
>
>oRecordSet=createobject(...
>
>*-- work with oRecordSet
>
>Return oRecordset = THIS LINE IS A PROBLEM. BAD RELEASING OF THE OBJECT IF IT HAVE REFERENCES TO OTHER OBJECTS.... MANUALLY DESTROY NOT WORK; UNASSIGNED MAYBE
>

I see no problems with this line of code. I do this sort of thing all of the time and have no problems. For one thing, if you are returning the recordset, you don't want to destroy the recordset.


>Something VFP release the object, somethings not. Why? I see something (in debug) how VFP destroy the object in caos order, so maybe the object is released AFTER the others or BEFORE the others...
>

It depends on what you are doing. In the above example, the recordset variable is localized. I see no problem with that. If you had the reference stored as a property of another object, then I could see problems.


>If a error ocurrs inside the method, is more problem... VFP not have a protection of error (Like Try..Except..End or Try..Finally in Delphi), so somethings the object still alive (and yes, i assign oRecordSet=.NULL., destroy the containers object, etc... I spend much time in it...)
>

VFP's error handling mechanism is pretty good. I agree that sometimes, object references can hang around after errors. I have seen it in VB as well. Still, VFP's error handling is pretty good. I suggest looking at your error handling code. You may be trying to do too much.


>Crahs, Red errors, OS Crahs, lost of code (Yes, something VFP destroy my code, forms, reports and projects!). This not is for a virus or bad machine, this happened in 4 different machines, in NT, 98 and 2000. Simply VFP have problems with COM (and yes, i have SP)
<

VFP works just fine with COM. I submit that many of the problems you are dealing with are related to your implementation..
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform