开发者

SQL/ASP - Invalid column name 'Email'

i am having trouble adding stuff into the Email column. I can add stuff into the Username column but for some reason i get the following error:

Microsoft OLE DB Provider for SQL Server error '80040e14'
Invalid column name 'Email'.

When I use this code:

Set rstSimple = cnnSimple.Execute("insert into SALT (Email, Username, FirstName, LastName, ActivationCode, TransactionID, ClientID) VALUES ('" & Request.QueryString("payer_email") & "','" & Request.QueryString("payer_email") & "','" & Request.QueryString("first_name") & "','" & Request.QueryString("last_name") & "','" & Request.QueryString("hash") & "','" & Request.Que开发者_开发知识库ryString("txn_id") & "','" & Request.QueryString("client_id") & "')")

Can somebody please help me?

Thank you


If the error states "Invalid column name 'Email' I would check:

  1. Does the column 'Email' exist in the database and in that format?

  2. What value are you inserting into the column? If Username works and Email doesn't, are they different types? Maybe Email doesn't except NULL values and Username does? If you are then trying to put a null e-mail address into Email then it won't work.

Other that looking at your database schema, there isn't much more I can guess from this.

Paul


I just encountered a similar problem today... reading values off the MSSQL database, the "Email" column is coming up blank/null in my ASP program.

But checking the table using SQL Enterprise Manager shows there is data in the "Email" column.

I couldn't find anything wrong with my code and I'm running out of ideas. Just for the heck of it, I tried to rename the field "Email" to something else, like "UserEmail". And voila!!!! My code is working again.

So try renaming your column "Email" to something else. I did some search and couldn't find anything that says "Email" is a reserved word in MSSQL and that you can't use "Email" for column names.


I do not know if it has an email column in it because none of the damn programs let me connect to the database

Try downloading and connecting SqlDbx to your database using the same ODBC connection. It will allow you to view the schema of your database easily and to edit and execute queries.

http://www.sqldbx.com/ (free for personal use)

Microsoft also has a SQL Server management express tool that is also free

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜