Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error while creating ADO recordset with VFPOLEDB
Message
 
 
To
07/06/2009 12:01:30
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01403799
Message ID:
01404299
Views:
38
>>>Were you able to solve the problem?
>>>
>>No, I left that company. Last time I asked my manager about the routine he told me it was not reliable. I haven't talked with him for a long time.
>
>Hi Naomi,
>
>I Googled "multistep operation generated errors" and ended up here:
>
>http://forums.devx.com/showthread.php?t=51579 where someone named Tejpal Mehta answered the following:
>
>
>This error basically indicates that one of the fields is getting invalid
>  data. That is, mostly wrong datatype, like text being fed to long datatype
>  field etc.
>
>So I looked back at the original cursor and started deleting items from the select that created it and discovered that the following field (there were several similar to it in the SELECT) caused the problem:
>
>IIF(EMPTY(AD.BuyFrac),0.000000,ROUND(AD.Availqty/AD.BuyFrac,6)) AS AvailDetailCantidad, ;
>
>Going on the assumption that "one of the fields was getting invalid data" I changed the code to say:
>
>IIF(EMPTY(AD.BuyFrac),0000000.000000,ROUND(AD.Availqty/AD.BuyFrac,6)) AS AvailDetailCantidad, ;
>
>and the problem went away.
>
>The root of the problem is that VFP tries to be forgiving in field overflows by first reducing the number of decimal places in a number, but an ADO recordset doesn't do the same.
>
>Maybe this is the problem you found at your old job.
>
>Alex

Thanks a lot for this pointer.

No, in our case the problem was something strange - less records in the Excel file than in the cursor.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform