Multiple-step ole db operation generated error - COM Vb6 dynamic SQL

Database
mar
Fan

Multiple-step ole db operation generated error - COM Vb6 dynamic SQL

Hi,

ASP Page is calling a COM object with dynamic sql query. Thiis query along with other may sqls were executing successfully connected to Oracle. i.e. the whole application works for many years.

Now the connection has been changed to Teradata and able to login successfully. But one of the queries in one of the screens gives the following error message. In this query nvl was changed to coalesce. But when this query is run directly in database it fetched the required rows but fails from the application at
.Open cmd, , adOpenForwardOnly, adLockBatchOptimistic

Err message: Multiple-step ole db operation generated error. check each ole db status value
----------------------------

With cmd
.CommandText = strSQL
.CommandType = adCmdText
End With

Set rs = New ADODB.Recordset
With rs
Set cmd.ActiveConnection = GetConnection()
' We will return the whole recordset.
.CursorLocation = adUseClient
.Open cmd, , adOpenForwardOnly, adLockBatchOptimistic
' Disconnect the recordset before returning it.
Set .ActiveConnection = Nothing
End If
End With

Tried to follow this link - http://support.microsoft.com/kb/269495 and I have installed the Teradata oledb as well but still error shows up.

Anyone have answers please.

thanks
1 REPLY
mar
Fan

Re: Multiple-step ole db operation generated error - COM Vb6 dynamic SQL

SELECT CASE SOQ.AdjustedQty
WHEN 0 THEN 0
ELSE -1 END AS Approved, SOQ.AdjustedQty AS AdjSOQ, SOQ.OriginalQty AS OrgSOQ,
Product.ProductCode AS ProductNumb, Product.Description AS Description,
CASE LocationProdFcst.PromotionID
WHEN 0 then 'No'
else 'Yes' END AS PromoInd, SOQ.OnHandRegular AS OnHandUnits, SOQ.OnOrderRegular AS OOUnits,
COALESCE(LocationProdFcst.DAYSSUPPLYONHAND,0) AS OHDaysSupply,
SOQ.MinShelf AS ShelfStock, SOQ.ARS AS ARS, SOQ.PackSize AS PackSize,
SOQ.ContributionCode AS ContCode, Product.SizeID AS ProductSize,
UPCProdRel.UPCNumber AS UPCNumber, SOQ.BottleOrderFlag AS BottleOrderFlag,
SOQ.ONORDERRESERVED AS OvrComQty
FROM SOQ, UPCProdRel , Product , LocationProdFcst
WHERE (SOQ.Class1ID = '00009'
AND Trim(SOQ.DistCode) = 'W002'
AND SOQ.LOCATIONTYPE = 'S'
AND SOQ.LOCATIONID = '00002'
AND SOQ.OriginalQty >= 0 )
AND SOQ.ProductNumber = UPCProdRel.ProductNumber
AND SOQ.ProductNumber = Product.ProductNumber
AND SOQ.LocationType = LocationProdFcst.LocationType
AND SOQ.LocationID = LocationProdFcst.LocationID
AND SOQ.ProductNumber = LocationProdFcst.ProductNumber
AND SOQ.SOQStatus <>3
ORDER BY ProductNumb ASC