Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursoradapter problem
Message
 
 
To
18/03/2010 13:07:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01455126
Message ID:
01456126
Views:
225
>>I have a cursoradapter class (ADO), i make a query on a table and i set buffering=3, i have set conversionfunc to convert empty date value to null, when i insert a new record i have an error. But if i use a little table (5 fields) no problem, i receive the error with another table (more than 100 fields in it).......where can be the problem ? The error is "Multiple-step OLE DB operation generated errors.
>>Check each OLE DB status value, if available. No work was done."........i have compiled the updatablefieldlist, but the updatenamelist is empty...because it is truncated with many fields...so i don't fill it.
>>Thanks
>
>You need updatablefieldlist and updatenamelist. You can do that in code. ie:
>
>
Define Class Ca_Person As CaBase Of ("CaBase.prg")
>  Alias = "Person"
>  SelectCmd = ;
>    "select personID, Firstname, Midname, Lastname, "+;
>    "Phone, Email, Address, City, State, Zip, "+;
>    "Createtime from Person"
>  CursorSchema = ;
>    "personID c(36) default uniqueID(), Firstname C(15), "+;
>    "Midname C(10), Lastname C(20), Phone C(15), Email C(40),"+;
>    "Address C(35), City C(15), State C(2), Zip C(10), "+;
>    "Createtime T default DATETIME()"
>  UpdatableFieldList = ;
>    "personID, Firstname, Midname, Lastname, Phone, Email,"+;
Your class is similar to mine, but i have always the same problem. I have a table, 3 fileds. I have set ConversionFunc to run a function like E2N. When i insert a new record i compile only two fields. The last one is empty and it is a character fields on which i have to do the e2n functions. I have inserted a messagebox in this function to see the value i pass and i have seen that the third field doesn't run the function if i dont' compile it.....why ?


>    "Address, City, State, Zip, Createtime"
>  UpdateNameList = ;
>    "personID Person.personID, Firstname Person.Firstname, "+;
>    "Midname Person.Midname, Lastname Person.Lastname, "+;
>    "Person.Phone, Email Person.Email, Address Person.Address, City "+;
>    "Person.City, State Person.State, Zip Person.Zip, "+;
>    "Createtime Person.Createtime"
>
>  KeyFieldList = "personID"
>  Tables = "Person"
>  ConversionFunc = ;
>    "Firstname TRIM, Midname TRIM, Lastname TRIM, "+;
>    "Phone TRIM, Email TRIM, Address TRIM, City TRIM, State TRIM, Zip TRIM,"+;
>    "Createtime E2N"
>
>  Procedure AfterCursorFill
>    Lparameters lUseCursorSchema, NoDataOnLoad, cSelectCmd, lResult
>    If Tagcount(This.Alias) = 0
>      CursorSetProp("Buffering",3,This.Alias)
>      Select (This.Alias)
>      Index On LASTNAME Tag 'Lastname'
>      Index On personID Tag 'personID'
>      CursorSetProp("Buffering",5,This.Alias)
>      Set Order To 0
>      If !Empty(This.Order)
>        Set Order To Tag (This.Order)
>      Endif
>    Endif
>  Endproc
>Enddefine
Previous
Reply
Map
View

Click here to load this message in the networking platform