softweng
May 9th, 2001, 04:04 PM
I have a database with several tables. One form has 8 text boxes and 8 combo boxes bound to a
table in the database through an ADODC control. When I delete records I sometimes get the following error.
-2147217887 Multiple Step Operation Generated Errors. Check Each Status Value.
This only happens sometimes, sometimes it deletes the record fine. I found out that if I do not
execute a certain procedure for filling the combo boxes, this error never occurs. I cannot see any
reason for this. I have included the procedure here to see if anyone can find the problem.
I have searched MSDN and Microsoft.com and have found nothing related to my problem.
All the fields in the table are "Text" with no special formating and they are set to allow 255 characters.
Any Help Is Greatly Appreciated!!!
private Sub FillPartBoxes()
Dim cndata as ADODB.Connection
Dim rsdata as ADODB.Recordset
Dim strSQL as string
Dim strField as string
Dim strData as string
Dim strSelectedPart as string
Dim i as Integer
Dim ii as Integer
on error GoTo ErrHandler
'//Define Connection And Recordset
set cndata = new ADODB.Connection
set rsdata = new ADODB.Recordset
'//Define Query string
Select Case m_Part
Case 0
strSQL = "SELECT * FROM [Springs];"
strField = "Spring"
Case 1
strSQL = "SELECT * FROM [Top Tumbler];"
strField = "Top Tumbler"
Case 2
strSQL = "SELECT * FROM [mid Tumbler];"
strField = "mid Tumbler"
Case 3
strSQL = "SELECT * FROM [Bottom Tumbler];"
strField = "Bottom Tumbler"
Case else
strSQL = "SELECT * FROM [Springs];"
strField = "Spring"
End Select
'//Open Connection
cndata.Open "DSN=NCLRecipe"
'//Open Recordset
rsdata.Open strSQL, cndata, adOpenKeyset, adLockOptimistic
'//Move to First Record
If Not rsdata.BOF then rsdata.MoveFirst
'//Clear Out Part Combo Boxes And Add A Selection for None
i = 0
for i = 0 to 7
cmbParts(i).Clear
cmbParts(i).AddItem "NONE"
next i
'//Fill Part Combo Boxes
i = 0
If (rsdata.RecordCount > 0) then
for i = 1 to rsdata.RecordCount
'//Fill Array Of Boxes
ii = 0
for ii = 0 to 7
strData = rsdata.Fields(strField).Value
cmbParts(ii).AddItem strData
strData = ""
next ii
If Not rsdata.EOF then rsdata.MoveNext
next i
End If
'//Display Database Values
If adodcCharts.Recordset.RecordCount > 0 then
i = 0
for i = 0 to 7
If Not IsNull(adodcCharts.Recordset.Fields("Part #" & (i + 1)).Value) then
strSelectedPart = adodcCharts.Recordset.Fields("Part #" & (i + 1)).Value
cmbParts(i).Text = strSelectedPart
strSelectedPart = ""
End If
next i
End If
'//Close Recordset And Connection
rsdata.Close
cndata.Close
'//set to nothing to Prevent Memory Leaks
set rsdata = nothing
set cndata = nothing
Exit Sub
ErrHandler:
ProccessError ("frmCharts.FillPartBoxes")
End Sub
Kris
Software Engineer
Phoenix,AZ
table in the database through an ADODC control. When I delete records I sometimes get the following error.
-2147217887 Multiple Step Operation Generated Errors. Check Each Status Value.
This only happens sometimes, sometimes it deletes the record fine. I found out that if I do not
execute a certain procedure for filling the combo boxes, this error never occurs. I cannot see any
reason for this. I have included the procedure here to see if anyone can find the problem.
I have searched MSDN and Microsoft.com and have found nothing related to my problem.
All the fields in the table are "Text" with no special formating and they are set to allow 255 characters.
Any Help Is Greatly Appreciated!!!
private Sub FillPartBoxes()
Dim cndata as ADODB.Connection
Dim rsdata as ADODB.Recordset
Dim strSQL as string
Dim strField as string
Dim strData as string
Dim strSelectedPart as string
Dim i as Integer
Dim ii as Integer
on error GoTo ErrHandler
'//Define Connection And Recordset
set cndata = new ADODB.Connection
set rsdata = new ADODB.Recordset
'//Define Query string
Select Case m_Part
Case 0
strSQL = "SELECT * FROM [Springs];"
strField = "Spring"
Case 1
strSQL = "SELECT * FROM [Top Tumbler];"
strField = "Top Tumbler"
Case 2
strSQL = "SELECT * FROM [mid Tumbler];"
strField = "mid Tumbler"
Case 3
strSQL = "SELECT * FROM [Bottom Tumbler];"
strField = "Bottom Tumbler"
Case else
strSQL = "SELECT * FROM [Springs];"
strField = "Spring"
End Select
'//Open Connection
cndata.Open "DSN=NCLRecipe"
'//Open Recordset
rsdata.Open strSQL, cndata, adOpenKeyset, adLockOptimistic
'//Move to First Record
If Not rsdata.BOF then rsdata.MoveFirst
'//Clear Out Part Combo Boxes And Add A Selection for None
i = 0
for i = 0 to 7
cmbParts(i).Clear
cmbParts(i).AddItem "NONE"
next i
'//Fill Part Combo Boxes
i = 0
If (rsdata.RecordCount > 0) then
for i = 1 to rsdata.RecordCount
'//Fill Array Of Boxes
ii = 0
for ii = 0 to 7
strData = rsdata.Fields(strField).Value
cmbParts(ii).AddItem strData
strData = ""
next ii
If Not rsdata.EOF then rsdata.MoveNext
next i
End If
'//Display Database Values
If adodcCharts.Recordset.RecordCount > 0 then
i = 0
for i = 0 to 7
If Not IsNull(adodcCharts.Recordset.Fields("Part #" & (i + 1)).Value) then
strSelectedPart = adodcCharts.Recordset.Fields("Part #" & (i + 1)).Value
cmbParts(i).Text = strSelectedPart
strSelectedPart = ""
End If
next i
End If
'//Close Recordset And Connection
rsdata.Close
cndata.Close
'//set to nothing to Prevent Memory Leaks
set rsdata = nothing
set cndata = nothing
Exit Sub
ErrHandler:
ProccessError ("frmCharts.FillPartBoxes")
End Sub
Kris
Software Engineer
Phoenix,AZ