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 error '80040e14' The name "Draft" is not permitted in this context
- Article ID:
102 - Date Created
Monday, February 14, 2011 - This Article Has been Viewed
1717 times - Short Desc
While creating your INSERT statement and adding in default values, you may inadvertently not add in the appropriate single Quotes where they belong causing the 80040e14 error. - Details
While creating your INSERT statement, you might want to add in a default value for 1 or more columns. In this process, you may accidentally forgot to add in the single Quotes that go around the intended value. In which case, you will experiance the following error.
Microsoft OLE DB Provider for SQL Server error '80040e14'
The name "Draft" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
/Page.asp, line 242 - Recreate Issue
To recreate this issue:
<%
sqlReply.ActiveConnection=rhcConn
sqlReply.commandtext="insert into TableName (MesTitle, MesBody, SenID, RecID, MySenFolder, SenNewOld)values(?,?,?,?,Draft,New)"
%>
In the above SQL Insert Statement we are trying to add a default value to the database.
The default values are: Draft & New
But, we have neglected to add in our single ' Quotes around our values.
This in return makes the 2 Values look like they are Column Names when they are not. - Resolve Issue
To resolve this issue.
<%
sqlReply.ActiveConnection=rhcConn
sqlReply.commandtext="insert into TableName (MesTitle, MesBody, SenID, RecID, MySenFolder, SenNewOld)values(?,?,?,?,'Draft','New')"
%>
In this example we have wrapped our Values with single Quotes so that the Statement will know that it is infact a Value that needs to be inserted into the database column.
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