Forum Moderators: open
i am getting this error on this site that i am trying to create.
Error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]The name 'nish' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted
All i am trying to do is add to a sql db.
not sure what to do
thanks
Example:
INSERT INTO [People] (Name,Email) VALUES ('Mike O'Nish','mike@onish.com')
Take a look at the example above - SQL is looking at the ' in O'Nish and wants to close the insert of the "name" field. Then it doesn't know what "nish" is and crashes.
An easy fix is to replace ' with double apostrophe ('') not (") and then re-replace it with a single ' when you run your SELECT statements.
If this isn't the problem you're having, post your INSERT statement and I'll take a look.