Microsoft Knowledge Base Email Alertz

KBAlertz.com: When you set or retrieve the Recordset property of a report in a Microsoft Access database (.mdb), you receive the following error message: Run-time error '2593': This feature is not available in an MDB. Run-time error '2593':

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 287437 - Last Review: January 31, 2007 - Revision: 4.2

You may receive the "Run-time error 2593" error message when you set or you retrieve the Recordset property of a report in an Access database

This article was previously published under Q287437
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

On This Page

SYMPTOMS

When you set or retrieve the Recordset property of a report in a Microsoft Access database (.mdb), you receive the following error message:
Run-time error '2593':

This feature is not available in an MDB.

CAUSE

Reports in a Microsoft Access database do not support the use of the Recordset property.

RESOLUTION

You can simulate binding a report to a DAO recordset object by setting the RecordSource property to the name of a table, a query, or an SQL SELECT statement. If you want to use the same source for the report as a DAO recordset that you have opened, set the RecordSource property of the report to the Name property of the DAO recordset. The following example shows you how to open a DAO recordset that is based on a query and how to set the RecordSource property of the report to the same source as the source of the recordset.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
  1. CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  2. Open the sample database Northwind.mdb.
  3. Close the Main Switchboard form when it appears.
  4. On the View menu, point to Database Objects, and then click Reports.
  5. In the Database window, click the Alphabetical List of Products report, and then click Design.
  6. On the View menu, click Properties to display the property sheet.
  7. On the Edit menu, click Select Report to verify that the property sheet being displayed is the one for the report.
  8. Click the Data tab, and then clear the RecordSource property.
  9. On the View menu, click Code to view the module of the form.
  10. Add the following code to the module:
    Private Sub Report_Open(Cancel As Integer)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        
        Set db = CurrentDb
        
        'Open a DAO recordset based on the Alphabetical List of Products query
        Set rs = db.OpenRecordset("Alphabetical List of Products", dbOpenDynaset)
        Me.RecordSource = rs.Name
    End Sub
    					
  11. On the File menu, click Close and Return to Microsoft Access.
  12. On the File menu, click Save, and then close the report.
  13. Open the Alphabetical List of Products report in print preview.
Note that the report is bound to data from the Alphabetical List of Products query, which was the source of the DAO recordset object.

STATUS

Microsoft has confirmed that this is a problem in Microsoft Access.

MORE INFORMATION

The Help topic for the Recordset property states that this property applies to reports. This is only true if the report is in a Microsoft Access project (.adp file), and you are binding the report to an ADO recordset or retrieving an ADO recordset from the report. The Recordset property does not apply to reports in a Microsoft Access database (.mdb file).

Steps to Reproduce the Behavior

  1. CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  2. Open the sample database Northwind.mdb.
  3. Close the Main Switchboard form when it appears.
  4. On the View menu, point to Database Objects, and then click Reports.
  5. In the Database window, click the Alphabetical List of Products report, and then click Design.
  6. On the View menu, click Properties to display the property sheet.
  7. On the Edit menu, click Select Report to verify that the property sheet being displayed is the one for the report.
  8. Click the Data tab, and then clear the RecordSource property.
  9. On the View menu, click Code to view the module of the form.
  10. Add the following code to the module:
    Private Sub Report_Open(Cancel As Integer)
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        
        Set db = CurrentDb
        Set rs = db.OpenRecordset("Alphabetical List of Products", dbOpenDynaset)
        Set Me.Recordset = rs
    End Sub
    					
  11. On the File menu, click Close and Return to Microsoft Access.
  12. On the File menu, click Save, and then close the report.
  13. Open the Alphabetical List of Products report in print preview. Note that you receive the following error message:
    Run-time error '2593':

    This feature is not available in an MDB.

APPLIES TO
  • Microsoft Access 2002 Standard Edition
  • Microsoft Office Access 2003
Keywords: 
kbbug kberrmsg kbnofix KB287437
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please