Home  >  Article  >  Database  >  asp执行sqlserver的insert into语句出现逗号错误

asp执行sqlserver的insert into语句出现逗号错误

WBOY
WBOYOriginal
2016-06-07 15:25:411408browse

谢谢你,你的意见提醒了我使用这语句: response.write(sql) '在这里输出一下sql语句 , 看看哪里有没有问题 response.end ' 停止 如下: sql="Insert InTo member2011(name,telphone,number,college,classname,iscadre,remark,position) values('"+sname+"',

谢谢你,你的意见提醒了我使用这语句:

response.write(sql) '在这里输出一下sql语句 , 看看哪里有没有问题
response.end ' 停止

如下:

sql="Insert InTo member2011(name,telphone,number,college,classname,iscadre,remark,position) values('"+sname+"','"+telphone+"','"+snumber+"','"+college+"','"+classname+"',"+iscadre+",'"+remark+",'"+position+"')"
response.write(sql) '在这里输出一下sql语句 , 看看哪里有没有问题
response.end ' 停止
Conn.Execute(sql)
Conn=nothing
Conn.Close

让我知道了问题所在,是因为我把那些变量放在了一个sub里面,成了局部变量,所以就在这个sub里面,那些变量为空。从而出问题了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn