Microsoft KB Archive/253674

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Article ID: 253674

Article Last Modified on 8/23/2001



APPLIES TO

  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft ActiveX Data Objects 2.6
  • Microsoft ActiveX Data Objects 2.7
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition



This article was previously published under Q253674

SYMPTOMS

When creating an ADO recordset using an Oracle Decode statement that returns null values, ADO generates the following error message:

Run-Time error 'Data Provider or other Service Returned an E_Fail Status.'

NOTE: This error does not occur when you use the Oracle 8.1.6 client.

RESOLUTION

Change the CursorLocation to adUseServer.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Visual Basic and create a Standard Exe project. Create a reference to Microsoft ActiveX Data Objects 2.1 or later.
  2. Place the following code into Form1.

    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    
    Private Sub Form_Load()
        'Comment out the line below to make it work.
        cn.CursorLocation = adUseClient
        cn.Open "Provider=MSDAORA;Data Source=YourOraclealias;User ID=YourUserID;Password=YourPassword"
        rs.Open "select decode(employee_id,'7394','matches','') from employee", cn, adOpenKeyset, adLockOptimistic
        Debug.Print rs(0)
    
    End Sub
                        
  3. Change the ConnectionString to use a valid Data Source.
  4. Run the project.Result: The above mentioned run-time error.

  5. Comment this line of code: cn.CursorLocation = adUseClient
  6. Run the project again.Result: No errors. The recordset contains nulls but is valid.


REFERENCES

Keywords: kboracle kbprb KB253674