Knowledge Base

BUG: Double Quotes in ESQL for C Can Cause C Compiler Errors

PSS ID Number: 125228

Article Last Modified on 12/15/1999


The information in this article applies to:


This article was previously published under Q125228

SYMPTOMS

When attempting to compile an Embedded SQL for C (ESQL-C) application after running the program through the precompiler (NSQLPREP.EXE and SQLPREP.EXE),the following syntax errors are produced by the compiler:
syntax error : missing ')' before identifier ....
illegal escape sequence

CAUSE

When precompiling with the /NOSQLACCESS parameter, if there are Transact- SQL statements with character strings in double quotes, the precompiler incorrectly builds the query string by using \\" instead of \" in the resulting .C file.

WORKAROUND

There are several ways to avoid this situation:

  • Use single quotes (') in the Transact-SQL character strings instead of double quotes (").
  • Use the /SQLACCESS option on the precompile. This will result in a stored procedure being generated for the Transact-SQL statement.
  • Edit the .C file after the precompile replacing the \\" with \" in the sqlxcall() function.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Embedded SQL for C Programmer's Toolkit version 4.22. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: ESQL for C Windows NT

Keywords: kbprogramming KB125228
Technology: kbAudDeveloper kbSQLeMCPTK422 kbSQLEmCPTKSearch kbSQLServSearch