C#应用程序中,用如下语句:strSQL="insert into tbl2005 (ID, PubType, Authors, DocTitle, SourceTitle,Language, DocType, AuthorsKeywords,KeywordsPlus, FirstAddress,AuthorsAddress,ReprintAddress,Citation,TimesCited,ISSN,PubDate,PubYear,Volume,Issue,BeginPage,EndPage,Pages,Subject,RuKu ) values ( "+i+",'"+strGetMatching[0]+"','"+strGetMatching[1]+"','"+strGetMatching[2]+"','"+strGetMatching[3]
+"','"+strGetMatching[4]+"','"+strGetMatching[5]+"','"+strGetMatching[6]+"','"+strGetMatching[7]+"','"+strFirst+"','"+strGetMatching[8]+"','"+strGetMatching[9]+"','"+strGetMatching[10]+"','"+strGetMatching[11]+"','"+strGetMatching[12]+"','"+strGetMatching[13]+"','"+strGetMatching[14]+"','"+strGetMatching[15]+"','"+strGetMatching[16]+"','"+strGetMatching[17]
+"','"+strGetMatching[18]+"','"+strGetMatching[19]+"','"+strGetMatching[20]+"','2005' )";以前好好的,现在说是“Insert into 语句语法错误”,设置断点,运行的时候快速监视copy出来,在Access里建立查询能够正常执行(以前程序里也能正常执行);然后修改为:strSQL="insert into tbl2005 values ( "+i+",'"+strGetMatching[0]+"','"+strGetMatching[1]+"','"+strGetMatching[2]+"','"+strGetMatching[3]+"','"+strGetMatching[4]+"','"+strGetMatching[5]+"','"+strGetMatching[6]+"','"+strGetMatching[7]+"','"+strFirst+"','"+strGetMatching[8]+"','"+strGetMatching[9]+"','"+strGetMatching[10]+"','"+strGetMatching[11]+"','"+strGetMatching[12]+"','"+strGetMatching[13]+"','"+strGetMatching[14]+"','"+strGetMatching[15]+"','"+strGetMatching[16]+"','"+strGetMatching[17]+"','"+strGetMatching[18]+"','"+strGetMatching[19]+"','"+strGetMatching[20]+"','2005' )";上午能正常执行,什么都没改,现在运行时出错,捕获异常,为“无当前记录”。并且,另外一条类似的语句:
strSQL1="insert into tbl2005Add (ID,AuthorsAddress,TimesCited,IsFirst,RuKu) values ("+i+",'"+strFirst+"','"+strGetMatching[11]+"','T','2005')";插入到同一个库的另一个表,执行正常,这是怎么回事?
+"','"+strGetMatching[4]+"','"+strGetMatching[5]+"','"+strGetMatching[6]+"','"+strGetMatching[7]+"','"+strFirst+"','"+strGetMatching[8]+"','"+strGetMatching[9]+"','"+strGetMatching[10]+"','"+strGetMatching[11]+"','"+strGetMatching[12]+"','"+strGetMatching[13]+"','"+strGetMatching[14]+"','"+strGetMatching[15]+"','"+strGetMatching[16]+"','"+strGetMatching[17]
+"','"+strGetMatching[18]+"','"+strGetMatching[19]+"','"+strGetMatching[20]+"','2005' )";以前好好的,现在说是“Insert into 语句语法错误”,设置断点,运行的时候快速监视copy出来,在Access里建立查询能够正常执行(以前程序里也能正常执行);然后修改为:strSQL="insert into tbl2005 values ( "+i+",'"+strGetMatching[0]+"','"+strGetMatching[1]+"','"+strGetMatching[2]+"','"+strGetMatching[3]+"','"+strGetMatching[4]+"','"+strGetMatching[5]+"','"+strGetMatching[6]+"','"+strGetMatching[7]+"','"+strFirst+"','"+strGetMatching[8]+"','"+strGetMatching[9]+"','"+strGetMatching[10]+"','"+strGetMatching[11]+"','"+strGetMatching[12]+"','"+strGetMatching[13]+"','"+strGetMatching[14]+"','"+strGetMatching[15]+"','"+strGetMatching[16]+"','"+strGetMatching[17]+"','"+strGetMatching[18]+"','"+strGetMatching[19]+"','"+strGetMatching[20]+"','2005' )";上午能正常执行,什么都没改,现在运行时出错,捕获异常,为“无当前记录”。并且,另外一条类似的语句:
strSQL1="insert into tbl2005Add (ID,AuthorsAddress,TimesCited,IsFirst,RuKu) values ("+i+",'"+strFirst+"','"+strGetMatching[11]+"','T','2005')";插入到同一个库的另一个表,执行正常,这是怎么回事?
解决方案 »
- 求高手指点。。。FtpWebRequest、FtpWebResponse定义变量时出现错误!
- 柯达扫描控件axImgScan1 如何设置扫描高宽
- 关于c#异步操作获取返回值的一个问题
- 求解决方法—>"因为所有池连接均在使用,并且达到了最大池大小"
- 小弟我在一公司实习项目遇到的问题
- 单线程UI卡住,改为多线程
- 如何取得treeview中的Node的key的值?
- 为什么李维现在才出了一本VCL深入架构陂析?
- 新项目,新建一个名为test.cs的cs文件,编译报错如下:未能找到为 Main 方法指定的“Test.cs”,何故,谢先?
- 求教:正则表达式
- 高手帮我看看代码,并发冲突 ,是什么原因呀?
- Session的问题,Asp.net板块没人回答我,期待这里的高手!!!
可是一直以来都是这么命名的,从来没出过错……
那么就会报错