Link to home
Start Free TrialLog in
Avatar of EXwithRaj
EXwithRaj

asked on

Multi-step operation generated errors.

I am facing 2 inexplicable problems using ADO recordset in VB6 with SQL Server:
1) After populating data-bound TextBoxes with data if  I delete the value in a TextBox   & then execute the Update method,I observed that the value doesn't change at the backend.That is the value should now be NULL.But the original value remains intact.
2) If  I delete the value in a TextBox & then programmatically assign a value to another field in the same recordset object & then Update,I get this error:
   Multi-step operation generated errors.Check each status value.
      What is the problem?Although sans deleting the value if  I just alter it then the data is properly saved.
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

do you have the primary key in your recordset ?
Dear EXwith Raj

50 points is not very generous!! It is one of those errors that pops up all the time if

a. Dhaest is absolutely correct - no primary key in the recordset causes it.
b. I have frequently found that it occurs if the recordset spans more than one table and some other error occurs - for example a data tupe mismatch. For some reason it does not tell you that it is a data type mismatch, presumably because there is a hierarchy of errors and Multi-step Op comes earlier in the hierarchy. Are you sure that you can set the field to NULL or ....

Just a thought- good luck!
Henry
ASKER CERTIFIED SOLUTION
Avatar of wraith821
wraith821

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EXwithRaj
EXwithRaj

ASKER

1) I've the Primary Key set.I never create table sans setting the PK.
2) wraith821,the "Allow Zero Length String" & Required properties are that of MS Access.But I am using SQL Server which I'd stated in my query.In SQL Server I've checked the AllowNull column for the relevant columns.
3) I've also detected that the 2 problems occur only in the case of numeric fields - not string fields.
4) MoveNext method is not required on my part.Because while saving my recordset is either empty(a query executed at start which returns nothing) or just 1 record.
5) My query doesn't span multiple table.It spans just 1 table.
6) My problems occur against SQL Server 7 & 2000.
7) Is this a know/unknown bug that I've detected?I've never faced this strange problem in MS Access.
8) Coming back to wraith821,your "Take the Binding out" suggestion is The Solution!Therefore,I've decided to collect data from these TextBoxes,assign it to the fields in the recordset & then save the data.It works.
    Sometimes simple solutions do escape your mind.Thanks anyway.
HAHAH! i sould have read better, i have been reading so many of these things i probably was thinking of another question when i typed half that answer then solved your dilema  with the end of it. Oh well as long as you got your solution.

Thanks
Nick
Glad you are solved but just one comment about data binding. I absolutely agree with Wraith - if you want to get on with it and be confident, do it yourself and forget the controls! However, I got to the stage where I was quite determined to make it work if I could. What I found most effective was to set the field in the datacontrol properties but not the datasource. In code I then do

SQLStmt = SELECT ...."
with adodc1
    .recordsource=SQLStmt
    .refresh
    set text1.datasource=.recordset
end with

It is a bit more coding but I do find it works consistently

Bye
Henry