Knowledge Base

BUG: Reserved Error when Entering Certain Valid SQL Statements

Article ID: 166674

Article Last Modified on 5/2/2006


APPLIES TO


This article was previously published under Q166674

SYMPTOMS

When using the DataForm wizard and selecting a SQL statement as a recordset type in step 2, if you enter a statement that selects more than two fields with the same name, either from a view or by multiple table selection, the DataForm wizard prompts a reserved error.

CAUSE

The problem is with the error handling in the wizard framework.

RESOLUTION

The workaround for this problem is to alias the second occurrence of the duplicate field names within the SQL statement. For example, "select authors.city, stores.city town from authors, stores" works, but the SQL statement below does not.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a project.
  2. Insert a dataconnection to pubs.
  3. From the File menu, select New, File Wizards, then Data Form Wizard.
  4. In step 1 of the Wizard, select the connection to pubs.
  5. In step 2, select "SQL statement, "next."
  6. In step 3, type the following valid SQL statement:
          select * from authors, stores
    					
  7. Click Next.
A reserved error (-2147220496) appears, and the wizard shuts down.

REFERENCES

For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:

Keywords: kbbug kbdatabase kbwizard kbpending KB166674