472,373 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

ASP database issue

not sure if this is the right place to ask but, when i run the following
query in ASP i get the error

Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid column name '2 UK lighting turnover from Indoor lighting'.

/qbrowse/forms/New Starter Feedback Form.asp, line 65

where line 65 executed the following sql statement
INSERT INTO tblNewStarter ([FormName], [Name], [Company], [1 UK turnover
from lighting products £], [Percentage], [2 UK lighting turnover from Indoor
lighting], [2 UK lighting turnover from Outdoor Lighting], [2 UK lighting
turnover from Loose lamps], [3 Route to Market Wholesale - Stock], [3 Route
to Market Wholesale - Project], [3 Route to Market Direct / End User], [3
Route to Market Retail], [3 Route to Market Other], [3 Route to Market
(please specify)], [4 UK Headcount External Salespeople - Stock], [4 UK
Headcount External Salespeople - Project], [4 UK Headcount Internal
Salespeople - Stock], [4 UK Headcount Internal Salespeople - Project], [4 UK
Headcount Other Salespeople], [5 How many UK regional sales offices ?],
[Where ?], [6Lighting Schemes], [6a Products Manufactured in UK], [6a
Products Manufactured in Central Europe], [6a Products Manufactured in
Eastern Europe], [6a Products Manufactured in Far East], [6a Products
Manufactured in Other], [6a Products Manufactured in (Please specify)], [6b
For UK Market UK], [6b For UK Market Central Europe], [6b For UK Market
Eastern Europe], [6b For UK Market Far East], [6b For UK Market Other],
[7Preferred ballast type], [8Component Supplier], [9 Are products
distributed from a central point or are there outlying distribution
centres?], [Where?], [10Product Return Policy], [11Samples], [12 Is the
company able to provide a mock-up for a large project ?], [Is this provided
free of charge ?], [13Sponsorship], [14 What is the company spend on
entertainment?], [What form does this take ?], lastupdateddate) VALUES ('New
Starter Feedback Form','John Peach','Peas ltd
','','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','' ,'','','','','','','','',
'6/4/2007')

Can anyone advise why this won't run in ASp but runs without it in SQL
itself

Thanks in anticipation

John
Jun 4 '07 #1
10 1773
John Peach wrote:
not sure if this is the right place to ask but, when i run the
following query in ASP i get the error

Microsoft OLE DB Provider for SQL Server error '80040e14'
What version of SQL Server is this?
>
Invalid column name '2 UK lighting turnover from Indoor lighting'.
I suspect that using a numeric character as the first character in the
field name is causing the problem. IIRC, you should not have even been
allowed to do that.
From BOL:
a..
1.. The first character must be one of the following:
2.. A letter as defined by the Unicode Standard 2.0. The Unicode
definition of letters includes Latin characters a-z and A-Z, in addition
to letter characters from other languages.
a.. The _ (underscore), @ (at sign), or # (number sign) symbol.
Certain symbols at the beginning of an identifier have special meaning
in SQL Server. An identifier beginning with @ denotes a local variable
or parameter. An identifier beginning with # denotes a temporary table
or procedure. An identifier beginning with double number signs (##)
denotes a global temporary object.

Some Transact-SQL functions have names that start with double at signs
(@@). To avoid confusion with these functions, it is recommended that
you do not use names that start with @@.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 4 '07 #2
I took your advice and stripped out the illegal characters, but still get an
error :

Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid column name 'UK lighting turnover from Indoor lighting'.

/qbrowse/forms/New Starter Feedback Form.asp, line 71

INSERT INTO tblNewStarter ([FormName], [Name], [Company], [UK turnover from
lighting products £], [Percentage], [UK lighting turnover from Indoor
lighting], [UK lighting turnover from Outdoor Lighting], [UK lighting
turnover from Loose lamps], [Route to Market Wholesale - Stock], [Route to
Market Wholesale - Project], [Route to Market Direct / End User], [Route to
Market Retail], [Route to Market Other], [Route to Market (please specify)],
[UK Headcount External Salespeople - Stock], [UK Headcount External
Salespeople - Project], [UK Headcount Internal Salespeople - Stock], [UK
Headcount Internal Salespeople - Project], [UK Headcount Other Salespeople],
[How many UK regional sales offices ?], [Where ?], [Lighting Schemes], [a
Products Manufactured in UK], [a Products Manufactured in Central Europe],
[a Products Manufactured in Eastern Europe], [a Products Manufactured in Far
East], [a Products Manufactured in Other], [a Products Manufactured in
(Please specify)], [b For UK Market UK], [b For UK Market Central Europe],
[b For UK Market Eastern Europe], [b For UK Market Far East], [b For UK
Market Other], [Preferred ballast type], [Component Supplier], [Are products
distributed from a central point or are there outlying distribution
centres?], [Where?], [Product Return Policy], [Samples], [Is the company
able to provide a mock-up for a large project ?], [Is this provided free of
charge ?], [Sponsorship], [What is the company spend on entertainment?],
[What form does this take ?], lastupdateddate) VALUES ('New Starter Feedback
Form','John Peach','Pea Soup
Ltd','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','' ,'','','','','','','','','',
'6/4/2007')

Again the statement execute in SQL without an issue

Any further advise would be appreciated

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:u2**************@TK2MSFTNGP02.phx.gbl...
John Peach wrote:
>not sure if this is the right place to ask but, when i run the
following query in ASP i get the error

Microsoft OLE DB Provider for SQL Server error '80040e14'

What version of SQL Server is this?
>>
Invalid column name '2 UK lighting turnover from Indoor lighting'.

I suspect that using a numeric character as the first character in the
field name is causing the problem. IIRC, you should not have even been
allowed to do that.
From BOL:
a..
1.. The first character must be one of the following:
2.. A letter as defined by the Unicode Standard 2.0. The Unicode
definition of letters includes Latin characters a-z and A-Z, in addition
to letter characters from other languages.
a.. The _ (underscore), @ (at sign), or # (number sign) symbol.
Certain symbols at the beginning of an identifier have special meaning
in SQL Server. An identifier beginning with @ denotes a local variable
or parameter. An identifier beginning with # denotes a temporary table
or procedure. An identifier beginning with double number signs (##)
denotes a global temporary object.

Some Transact-SQL functions have names that start with double at signs
(@@). To avoid confusion with these functions, it is recommended that
you do not use names that start with @@.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jun 4 '07 #3

"John Peach" <jo********@zen.co.ukwrote in message
news:46***********************@news.zen.co.uk...
>I took your advice and stripped out the illegal characters, but still get
an error :

Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid column name 'UK lighting turnover from Indoor lighting'.

/qbrowse/forms/New Starter Feedback Form.asp, line 71

INSERT INTO tblNewStarter ([FormName], [Name], [Company], [UK turnover
from lighting products £], [Percentage], [UK lighting turnover from Indoor
lighting], [UK lighting turnover from Outdoor Lighting], [UK lighting
turnover from Loose lamps], [Route to Market Wholesale - Stock], [Route to
Market Wholesale - Project], [Route to Market Direct / End User], [Route
to Market Retail], [Route to Market Other], [Route to Market (please
specify)], [UK Headcount External Salespeople - Stock], [UK Headcount
External Salespeople - Project], [UK Headcount Internal Salespeople -
Stock], [UK Headcount Internal Salespeople - Project], [UK Headcount Other
Salespeople], [How many UK regional sales offices ?], [Where ?], [Lighting
Schemes], [a Products Manufactured in UK], [a Products Manufactured in
Central Europe], [a Products Manufactured in Eastern Europe], [a Products
Manufactured in Far East], [a Products Manufactured in Other], [a Products
Manufactured in (Please specify)], [b For UK Market UK], [b For UK Market
Central Europe], [b For UK Market Eastern Europe], [b For UK Market Far
East], [b For UK Market Other], [Preferred ballast type], [Component
Supplier], [Are products distributed from a central point or are there
outlying distribution centres?], [Where?], [Product Return Policy],
[Samples], [Is the company able to provide a mock-up for a large project
?], [Is this provided free of charge ?], [Sponsorship], [What is the
company spend on entertainment?], [What form does this take ?],
lastupdateddate) VALUES ('New Starter Feedback Form','John Peach','Pea
Soup
Ltd','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','' ,'','','','','','','','','',
'6/4/2007')

Again the statement execute in SQL without an issue

Any further advise would be appreciated

I would be v. wary of using any column names containing spaces or question
marks or even say 25 chars. Some of your column names remind me of
Cobol - which must have been the most verbose language ever used. Ok,
**some** databases **might** allow it, but there is way too much legacy code
kicking around in most products that would have a fit as soon as it sees
those characters. Stick to a-z and _ is my advice.
--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
Jun 4 '07 #4
it says "invalid coulmn name" so verify if spelling in column name exactly matches name in sql statement. Also check spaces which
may not match.


"John Peach" <jo********@zen.co.ukwrote in message news:46**********************@news.zen.co.uk...
not sure if this is the right place to ask but, when i run the following query in ASP i get the error

Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid column name '2 UK lighting turnover from Indoor lighting'.

/qbrowse/forms/New Starter Feedback Form.asp, line 65

where line 65 executed the following sql statement
INSERT INTO tblNewStarter ([FormName], [Name], [Company], [1 UK turnover from lighting products £], [Percentage], [2 UK lighting
turnover from Indoor lighting], [2 UK lighting turnover from Outdoor Lighting], [2 UK lighting turnover from Loose lamps], [3
Route to Market Wholesale - Stock], [3 Route to Market Wholesale - Project], [3 Route to Market Direct / End User], [3 Route to
Market Retail], [3 Route to Market Other], [3 Route to Market (please specify)], [4 UK Headcount External Salespeople - Stock], [4
UK Headcount External Salespeople - Project], [4 UK Headcount Internal Salespeople - Stock], [4 UK Headcount Internal
Salespeople - Project], [4 UK Headcount Other Salespeople], [5 How many UK regional sales offices ?], [Where ?], [6Lighting
Schemes], [6a Products Manufactured in UK], [6a Products Manufactured in Central Europe], [6a Products Manufactured in Eastern
Europe], [6a Products Manufactured in Far East], [6a Products Manufactured in Other], [6a Products Manufactured in (Please
specify)], [6b For UK Market UK], [6b For UK Market Central Europe], [6b For UK Market Eastern Europe], [6b For UK Market Far
East], [6b For UK Market Other], [7Preferred ballast type], [8Component Supplier], [9 Are products distributed from a central
point or are there outlying distribution centres?], [Where?], [10Product Return Policy], [11Samples], [12 Is the company able to
provide a mock-up for a large project ?], [Is this provided free of charge ?], [13Sponsorship], [14 What is the company spend on
entertainment?], [What form does this take ?], lastupdateddate) VALUES ('New Starter Feedback Form','John Peach','Peas ltd
','','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','' ,'','','','','','','','',
'6/4/2007')

Can anyone advise why this won't run in ASp but runs without it in SQL itself

Thanks in anticipation

John


Jun 4 '07 #5
John Peach wrote:
I took your advice and stripped out the illegal characters, but still
get an error :
By "stripping out", do you mean you changed the names of the fields in
the database? or did you merely remove the characters from your sql
statement?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 4 '07 #6
LOL, no the fields in the database match the names in the SQL statement, as
stated the SQL statement runs prefectly from the Servera and the record gets
inserted into the database, just will not run from ASP

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
John Peach wrote:
>I took your advice and stripped out the illegal characters, but still
get an error :

By "stripping out", do you mean you changed the names of the fields in
the database? or did you merely remove the characters from your sql
statement?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jun 4 '07 #7
I know this could be construed as dodging the question, but I have to
ask: is there a reason you have not encapsulated this long sql statement
into a stored procedure?

I'd like to try to reproduce your problem, so can you let me know what
version of SQL Server you are using? Also, can you verify if the
following statement reproduces the problem:

INSERT INTO tblNewStarter ([FormName], [Name], [Company],
[UK turnover from lighting products £], [Percentage],
[UK lighting turnover from Indoor lighting])
VALUES ('New Starter Feedback Form',
'John Peach','Pea Soup Ltd','','','')

John Peach wrote:
LOL, no the fields in the database match the names in the SQL
statement, as stated the SQL statement runs prefectly from the
Servera and the record gets inserted into the database, just will not
run from ASP

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
>John Peach wrote:
>>I took your advice and stripped out the illegal characters, but
still get an error :

By "stripping out", do you mean you changed the names of the fields
in the database? or did you merely remove the characters from your
sql statement?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 4 '07 #8
The insert statement you put forward ran without issue

Will go the stored procedure route if i can't get this sql statement to work

Running on SQL 2000

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I know this could be construed as dodging the question, but I have to
ask: is there a reason you have not encapsulated this long sql statement
into a stored procedure?

I'd like to try to reproduce your problem, so can you let me know what
version of SQL Server you are using? Also, can you verify if the
following statement reproduces the problem:

INSERT INTO tblNewStarter ([FormName], [Name], [Company],
[UK turnover from lighting products £], [Percentage],
[UK lighting turnover from Indoor lighting])
VALUES ('New Starter Feedback Form',
'John Peach','Pea Soup Ltd','','','')

John Peach wrote:
>LOL, no the fields in the database match the names in the SQL
statement, as stated the SQL statement runs prefectly from the
Servera and the record gets inserted into the database, just will not
run from ASP

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
>>John Peach wrote:
I took your advice and stripped out the illegal characters, but
still get an error :
By "stripping out", do you mean you changed the names of the fields
in the database? or did you merely remove the characters from your
sql statement?


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jun 5 '07 #9
John Peach wrote:
The insert statement you put forward ran without issue
Really? So that means the problem lies elsewhere. Add fields in
one-at-a-time until you discover the actual culprit.
Will go the stored procedure route if i can't get this sql statement
to work
Running on SQL 2000
Frankly, I would stop wasting time and convert it to a stored procedure
which can easily be executed from asp. Aee:
http://groups.google.com/group/micro...9dc1701?hl=en&

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jun 5 '07 #10
Thanks for the advice, eventually went forthe route of a Stored procedure
and all is working well now

Regards

John

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:uD**************@TK2MSFTNGP05.phx.gbl...
John Peach wrote:
>The insert statement you put forward ran without issue

Really? So that means the problem lies elsewhere. Add fields in
one-at-a-time until you discover the actual culprit.
>Will go the stored procedure route if i can't get this sql statement
to work
Running on SQL 2000

Frankly, I would stop wasting time and convert it to a stored procedure
which can easily be executed from asp. Aee:
http://groups.google.com/group/micro...9dc1701?hl=en&

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jun 6 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
6
by: N. Graves | last post by:
Thank you for taking your time to read my question... please offer your knowledge it will be appreciated! I'm writing a ASP Web page to access a Access Database that has a Database Password set....
1
by: Larry Dooley | last post by:
Here's my issue. We've decided to replace a very critical (without it the business would lose lots of money) departmental reporting system with a built from scratch system based on .NET. The key...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
1
by: vbace2 | last post by:
I have searched this forum, and the web, and I have not been able to find a solution to my issue. I may not have used the right search information to find the answer, but I found a lot of issues...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.