CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
Microsoft OLE DB Provider for SQL Server (0x80040E14) Incorrect syntax near the keyword 'off' or Incorrect syntax near the keyword 'on'
- Article ID:
74 - Date Created
Monday, December 20, 2010 - Last Updated
Monday, December 20, 2010 - This Article Has been Viewed
2330 times - Short Desc
When migrating from Access Database to SQL Server, you will have to change your ASP code to work with the new database settings. - Details
When you migrate from Access Database to SQL Server, there are several things that need to be changed.
Access uses the Yes/No Data Type, and in SQL Server you can use the BIT Data Type.
Once you convert over to BIT in SQL Server, you will get an error like this.
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'off'.
/NewInserts.asp, line 96
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'on'.
/NewInserts.asp, line 96 - Recreate Issue
To recreate the error. Set Data Type to BIT and use the following SQL Statement.
<%
sql.commandtext="update mytable set mycol=off where myid=1"
%><%
sql.commandtext="update mytable set mycol=on where myid=1"
%>
In Access with the Yes/No Data Type, this code is correctly written, but not in SQL Server. - Resolve Issue
In SQL Server we are using the BIT value and we will need to change the off to 0
0 = off
1 - on
<%
sql.commandtext="update mytable set mycol=0 where myid=1"
%><%
sql.commandtext="update mytable set mycol=1 where myid=1"
%>
--------
Related Articles
Microsoft OLE DB Provider for SQL Server (0x80040E14) Invalid column name ''«
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825