简体   繁体   中英

SQL Server error '80040e14' incorrect syntax on SQL Server 2012

I am tasked with migrating a Classic ASP web application with SQL Server 2005 database from Windows Server 2003 (32bit) to Windows Server 2012 R2 with SQL Server 2012.

The code is very old and I don't want to do any code changes to make this workable in the above mentioned environment.

I have achieved almost all of the above but when testing the web application at a certain page where a report generation command is given the application breaks with error...

Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near '*'.
D:\\WEBSITES\\XXXXXXXXX\\REPORTS../common.asp, line 84

Following is the line 84 code:

rs.Open sql, cn, adOpenStatic, adLockReadOnly, adCmdText

Strangely when I change the SQL Server from 2012 to SQL Server 2008 R2, the application works properly and generates the required report and displays in the browser.

I would also like to mention that this code/database combination works properly on Windows 2003(IIS6)/SQL Server 2005.

I have tried by changing the compatibility mode of SQL Server 2012 to SQL 2005 (90) but that has not helped.

Any help will be highly appreciated.

I'm late to the game, but I was receiving the same error number and was pulling my hair out to determine the cause. It turned out to be one of my column names "Module" must be a keyword. When I enclosed the Module name as so "[Module]", all worked fine. So you might check to determine if one of the words in your code is now considered a keyword. (I believe this might be the case as the newer version probably has more keywords.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM