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) The name "" is not permitted in this context.
- Article ID:
79 - Date Created
Saturday, December 25, 2010 - This Article Has been Viewed
1778 times - Short Desc
When passing values to our SQL Statements, we cannot add in the Variables into the statement itself without adding in the appropriate characters that are required. They are thought of as Column Names in this context. - Details
Adding in our Variables into the SQL Statement without the appropriate characters as in:
"&MyVariable&" (or) ? will give the error below, as it thinks that you are trying to pass a Column Name in place of the Variable value.
Microsoft OLE DB Provider for SQL Server (0x80040E14)
The name "tdate" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
/NewInserts.asp, line 415 - Recreate Issue
To Recreate this issue.
<%
sqlBlList.commandtext="insert into BlackListed (IPAddress, uDate)values(?,tdate)"
sqlBlList.Parameters.Append sqlBlList.CreateParameter("@IPAddress", advarchar, adParamInput, 50,tempID)
%>
As you can see, we are trying to pass the tdate in our value section of our INSERT statement, and this is not allowed. - Resolve Issue
To correct this issue, add the Variable in the right location, and put the ? in your value section of your INSERT code, as shown below.
<%
sqlBlList.commandtext="insert into BlackListed (IPAddress, uDate)values(?,?)"
sqlBlList.Parameters.Append sqlBlList.CreateParameter("@IPAddress", advarchar, adParamInput, 50,tempID)
sqlBlList.Parameters.Append sqlBlList.CreateParameter("@uDate", advarchar, adParamInput, 30,tdate)
%>
In the above, we are passing all our values in our Parameters.
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