I am using hresult
Recordset15: open (const _ variant_t
& Amp; source,...) function where
Source ="
Roworder as (select [Chart number] from [DBO]. [Patient]) Select * From roworder "in C ++ module on SQL 2005 version 2005.90.3233.0. The msado15.dll version is
2.81.1132.0.
It
Returns db_e_errorsincommand-"incorrect syntax near the keyword ''".
Error numbers: 0x80040e14, 0x00000c14
Short error:
Incorrect syntax near the keyword''
Error:
Source: Microsoft ole db provider for SQL Server
Description: incorrect syntax near the keyword 'with'
Error message: idispathch Error #3092
This query works fine on Microsoft SQL Server Management studio Express version
9.00.3042.00.
Standard query like "select * from [DBO]. [Patient]" works without problem.
Any suggestions?
-------------------------------------------------------------
Try
Adding a semi colon; before your with statement
-------------------------------------------------------------
Unbelievable, but it works after.
Thank you.