Recordset update raising Multiple-step operation error with DISTINCT clause
776449Jun 1 2010 — edited Jun 18 2010Dear All,
Urgent help need.
I am getting "Multiple-step operation generated errors." when I tried to modify the record set retrieved using a select query having DISTINCT clause. I am using Windows XP OS, with ADO 2.8 and Oracle 10G DB, Oracle Client 10.2.0.2.
A standard windows exe is created for testing using VB6 with the sample code as shown below:
Dim strSQL As String
Dim strConnString As String
Dim objCnn As New ADODB.Connection
Dim adRecordset As New ADODB.Recordset
strConnString = "Provider=OraOLEDB.Oracle;Data Source=<>;User ID=<>;Password=<>;"
objCnn.Open strConnString
strSQL = "select DISTINCT EMPNAME from EMPLOYEES where DEPT='PROD'"
adRecordset.CursorLocation = adUseClient
adRecordset.Open strSQL, objCnn, adOpenKeyset, adLockOptimistic, adCmdText
adRecordset.Fields(0).Value = "TESTING"
Set adRecordset = Nothing
objCnn.Close
Set objCnn = Nothing
The error is throwing from the line in bold type. If I remove the DISTINCT clause, the above code works fine.
The application is a ASP/COM based web application using Oracle as back end. The application was working fine till I changed the provider from Microsoft OLE DB to Oracle. Microsoft is not currently supporting the MSDAORA provider and I am forced to move to Oracle provider.
I appreciate your advice.
Regards
Krishna