ASP数据库问题 [英] ASP database issue
问题描述
不确定这是否是正确的问题但是,当我在ASP中运行以下
查询时我得到错误
Microsoft OLE DB SQL Server错误提供商''80040e14''
无效的列名称''2英国室内照明灯光营业额''。
/ qbrowse / forms / New Starter Feedback Form.asp,第65行
其中第65行执行以下sql语句
INSERT INTO tblNewStarter([FormName],[名称],[公司],[1英国营业额
来自照明产品],[百分比],[2英国照明营业额来自室内
照明],[2英国室外照明的照明营业额],[2英国照明
从散装灯的营业额],[3路到市场批发 - 股票],[3路
到市场批发 - 项目],[3通往市场直销/最终用户的途径],[3
通往市场零售的途径],[3通往市场的其他途径],[3通往市场的途径
(请注明)],[4 UK Headcount Ext ernal Salespeople - Stock],[4 UK
人员外部销售人员 - 项目],[4英国人员内部
销售人员 - 股票],[4英国人员内部销售人员 - 项目],[4英国
人数其他销售人员],[5多个英国区域销售办事处?],
[Where?],[6Lighting Schemes],[6a产品在英国制造],[6a
产品在中欧制造],[6a产品在东欧
制造],[6a产品在远东制造],[6a产品
其他制造商,[6a产品(请注明)],[6b
英国英国市场],[6b英国中欧市场], [6b英国市场
东欧],[6b英国市场远东],[6b英国市场其他],
[7Preferred ballast type],[8Component供应商],[9产品
从中心点分发还是在外围分销
中心?],[Where?],[10Product Return Policy],[11S amples],[12
公司是否可以为大型项目提供模型?],[这是免费提供的吗?b $ b],[13赞助],[14公司花在
娱乐上的费用是什么?],[这采取什么形式?],lastupdateddate)VALUES(''新
入门反馈表' ',''John Peach'',''Peas ltd
'','''','''','''','''','''',' '' ' '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '',' ''',''','''','''','''','''''''''''''''''''''''''''''''''' ''',''','''','''','''','''''''''''''''''''''''''''''''''' ''',''''''''''''''''''''''''''''''''''''''''''''' >
任何人都可以告诉为什么这会赢得''在ASp中运行但在SQL中没有它运行
本身
感谢您的期待
John
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
推荐答案
John Peach写道:
John Peach wrote:
不确定这是否是正确的地方,但是,当我在ASP中运行
以后查询时我得到错误
Microsoft OLE DB Provider for SQL Server错误''80040e14''
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''
这是什么版本的SQL Server?
What version of SQL Server is this?
>
无效的列名称''2英国室内照明的灯光营业额''。
>
Invalid column name ''2 UK lighting turnover from Indoor lighting''.
我怀疑使用数字字符作为
字段名中的第一个字符会导致问题。 IIRC,你甚至不应该允许这样做。
来自BOL:
a ..
1 ..第一个字符必须是以下之一:
2 .. Unicode标准2.0定义的字母。 Unicode
字母的定义包括拉丁字符az和AZ,另外
来自其他语言的字母。
a .. _ (下划线),@(符号)或#(数字符号)符号。
标识符开头的某些符号在SQL Server中具有特殊含义
。以@开头的标识符表示局部变量
或参数。以#开头的标识符表示临时表
或过程。以双数字符号开头的标识符(##)
表示全局临时对象。
某些Transact-SQL函数的名称以符号开头为double
(@@)。为避免与这些功能混淆,建议您不要使用以@@开头的名字。
-
Microsoft MVP - ASP / ASP.NET
请回复新闻组。我的From
标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。
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.
我接受了您的建议,并删除了非法字符,但仍然得到了
错误:
Microsoft OLE DB Provider for SQL Server错误''80040e14''
无效的列名''室内照明的英国照明营业额''。
/ qbrowse / forms / New Starter Feedback Form.asp,第71行
INSERT INTO tblNewStarter([FormName],[姓名],[公司],[英国营业额来自
照明产品],[百分比],[英国室内照明营业额
照明],[英国照明营业额来自户外照明],[英国照明
来自散装灯的营业额],[路线到市场批发 - 股票],[路线到
市场批发 - 项目],[市场直销/最终用户的路线],[路线到市场零售的市场零售],[市场其他路线],[市场路线(请注明)],>
[UK Headcount Ex ternal Salespeople - Stock],[英国人数外部
销售人员 - 项目],[英国人员内部销售人员 - 股票],[英国
[多少个英国区域销售办事处?],[Where?],[Lighting Lighting],[a
产品在英国制造], [在中欧制造的产品],
[在东欧制造的产品],[远东制造的产品
东],[其他制造的产品] ,[产品制造商
(请注明)],[b英国英国市场],[b英国中欧市场],
[b英国市场东欧],[b对于英国远东市场],[b对于英国
市场其他],[首选镇流器类型],[组件供应商],[是产品
从中心点分发还是有外围分布
中心?],[哪里?],[产品退货政策],[样品],[公司是
能够为大型项目提供模型?],[这是否免费提供?b $ b费用?],[赞助商],[公司在娱乐上的花费是多少?],
[这采取什么形式?],lastupdateddate)VALUES(''新的起始反馈
表'',''John Peach'',''豌豆汤
有限公司'',''','''','''''''''''''''''''''''''''''''''''''''''''''' ',''','''','''',''''''''''''''''''''''''''''''''''''''''''''''''' ' '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', ''' ',''','''','''',''''''''''''''''''''''''''''''''''''''''''''''''' ','''','''',
''6/4/2007'')
再一次,语句在SQL中执行而没有问题
更进一步建议将不胜感激
问候
John
" Bob Barrows [MVP]" ; < re ****** @ NOyahoo.SPAMcomwrote in message
news:u2 ************** @ TK2MSFTNGP02.phx.gbl ...
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写道:
John Peach wrote:
>不确定这是否是正确的地方,但是,当我在ASP中运行
以下查询我得到错误
用于SQL Server的Microsoft OLE DB提供程序错误''80040e14''
>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''
这是什么版本的SQL Server?
What version of SQL Server is this?
>>
无效的列名称''2英国室内照明灯光营业额''。
>>
Invalid column name ''2 UK lighting turnover from Indoor lighting''.
我怀疑使用数字字符作为
字段名中的第一个字符会导致问题。 IIRC,你甚至不应该允许这样做。
来自BOL:
a ..
1 ..第一个字符必须是以下之一:
2 .. Unicode标准2.0定义的字母。 Unicode
字母的定义包括拉丁字符az和AZ,另外
来自其他语言的字母。
a .. _ (下划线),@(符号)或#(数字符号)符号。
标识符开头的某些符号在SQL Server中具有特殊含义
。以@开头的标识符表示局部变量
或参数。以#开头的标识符表示临时表
或过程。以双数字符号开头的标识符(##)
表示全局临时对象。
某些Transact-SQL函数的名称以符号开头为double
(@@)。为避免与这些功能混淆,建议您不要使用以@@开头的名字。
-
Microsoft MVP - ASP / ASP.NET
请回复新闻组。我的From
标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。
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.
" John Peach" < jo ******** @ zen.co.ukwrote in message
news:46 ******************** *** @ news.zen.co.uk ...
"John Peach" <jo********@zen.co.ukwrote in message
news:46***********************@news.zen.co.uk...
>我接受了你的建议并剥夺了非法角色,但仍然得到了
错误:
用于SQL Server的Microsoft OLE DB提供程序错误''80040e14''
无效的列名''英国室内照明营业额照明''。
/ qbrowse / forms /新的入门反馈Form.asp,第71行
INSERT INTO tblNewStarter([FormName], [名称],[公司],[英国营业额
来自照明产品],[百分比],[英国照明营业额来自室内
照明],[英国照明营业额来自室外照明],[英国照明
从松散灯的营业额],[路线到市场批发 - 股票],[路线到
市场批发 - 项目],[路线市场直销/最终用户],[路线
到市场零售],[路线到市场其他],[路线到市场(请
指定)],[英国人员外部销售人员 - 股票],[英国人数
外部销售人员 - 项目],[英国人员内部销售人员 -
股票],[英国人员内部销售人员 - 项目],[英国人数其他人员b $ b销售人员],[英国多少个区域销售办事处?],[哪里?],[照明
方案],[在英国制造的产品],[在中欧的b $ b制造的产品],[在东欧制造的产品],[a产品
[远东制造],[其他产品制造],[a产品
制造(请注明)],[b英国英国市场],[b英国市场>
中欧],[b英国市场东欧],[b英国市场远东b / b $ b东],[b英国市场其他],[首选镇流器类型],[组件
供应商],[产品是从中心点分发还是
边远配送中心?],[哪里?],[产品退货政策],
[样品],[公司是否可以为大型项目提供模型
?],[这是免费提供的吗?],[赞助商],[什么这是
公司在娱乐方面的花费吗?],[这采取什么形式?],
lastupdateddate)VALUES(''New Starter Feedback Form'',''John Peach'',''Pea
Soup
Ltd'','''','''','''',''''''' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '', '' '',''',''','''','''','''''''''''''''''''''''''''''''''' '',''',''','''','''','''''''''''''''''''''''''''''''''' '',''''''''''''''''''''''''''''''''''''''''''''''''''''''''' )
再次声明在SQL中执行没有问题
任何进一步的建议将不胜感激
>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
我会谨慎使用任何包含空格的列名或问题
标记甚至说25个字符。你的一些专栏名称让我想起了
Cobol - 它一定是有史以来最冗长的语言。好的,
**一些**数据库**可能**允许它,但是有太多的遗留代码
在大多数适合的产品中蠢蠢欲动一看到这些人物,就会看到这些人物。坚持az和_是我的建议。
-
John Blessing
http://www.LbeHelpdesk.com - 价格适合所有
商家的服务台软件
为您在网上的会议/课程。
http ://www.lbetoolbox.com - 从MS Outlook中删除重复项,查找/替换,
发送新闻稿
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
这篇关于ASP数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!