SAP Knowledge Base Article - Public

3018712 - Database Connector Error: "HY000:[SAP Crystal reports] Database Vendor Code: 102]" when refreshing a report based on MS SQL Server in Crystal Reports

Symptom

  • Error refreshing a report based on SQL Server.
  • When refreshing a report based on MS SQL Server in Crystal Reports, it fails with the error:
       
       "Database Connector Error: "HY000:[SAP Crystal Reports][ODBC SQL Server Wire Protocol driver][Microsoft SQL server]
        Incorrect syntax near the keyword '<Table Name>'. [Database Vendor Code: 102 ]"

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
        
  • MS SQL Server

Reproducing the Issue

  1. In Crystal Reports, open a report based on MS SQL Server
  2. When refreshing the report, it fails with the error: 
       
    "Database Connector Error: "HY000:[SAP Crystal Reports] Database Vendor Code: 102]"

Cause

Resolution

  • To successfully refresh the report:
    • Assign an alias to the Table name, that uses a reserved word; or
    • Change how the SQL Query is generated, and add double quotes around the Table Name; or
    • Contact your Database Administrator to rename the Table on the database side, to a name that does not use a reserved database word.
          
               
  • Assign an alias to the Table name, that uses a reserved word.
        
    1. In Crystal Reports, open the report.
       
    2. Under the menu "Database", select "Database Expert"
       
    3. In the "Database Expert", under "Selected Tables", find the Table that uses a reserved word in the database.
       
    4. To give an alias name to the Table, right click on it, and select "Rename" 
       
    5. Enter an alias Table name that is not a reserved word. For example: For a Table named: "Group", renamed it to "Group_1" 
       
    6. Click "OK" to accept the change.
        
    7. Save the report.
         
  • Change how the SQL Query is generated, and add double quotes around the Table Name
        
    • To generate a SQL Query that add double quotations around Table Names, follow the steps found in the SAP Knowledge Base Article:
            
       1217820 - Registry settings to configure how the SQL Query is generated in Crystal Reports 

See Also

  • 1208719 - ODBC error: Syntax error in ORDER BY clause, when refreshing a report in Crystal Reports
  • 1315377 - Database Connector Error:'HY000:[Crystal Reports][ODBC XML Driver]...when adding a table from an XML data source in Crystal Reports

Keywords

CR , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020