主题:紧急求助:关于insert into的语法问题
我是一个新手,正在自学ASP,可insert into出现了问题,我昨天刚用同样的语法写了insert into的语句还运行正确了,可今天却又出错误了,我实在找不到问题出在哪里,请各位高手帮忙,告急!!!!!!!!!!!!!!我的程序代码如下:
<%
dim conn
set conn=server.CreateObject("adodb.connection")
conn.open "www"
if conn.state=1 then
response.Write "数据库连接成功"
elseif conn.state=0 then
response.Write "数据库没有连接成功"
end if
dim strsql,values
dim n1,a1,p1,t1,s1,e1,m1
n1=request("name")
a1=request("address")
p1=request("person")
t1=request("tel")
s1=request("start_date")
e1=request("end_date")
m1=request("money")
if request("name")="" or request("tel")="" then
strsql="insert into kehu (name,address,person,tel,start_date,end_date,money) values('"+n1+"','"+a1+"','"+p1+"','"+t1+"','"+s1+"','"+e1+"','"+m1+"')"
conn.execute(strsql)
end if
if conn.errors.count>0 then
response.Write "保存过程中发生错误,必须重新填写"
else
response.Write "<p>姓名:"& name
end if
dim i,err
for i=1 to conn.errors.count
set err=conn.errors.item(i-1)
response.Write "错误描述:"& err.description & "<br>"
response.Write "错误原因:" & err.source & "<br>"
next
数据库已经连接成功。
错误描述:[Microsoft][ODBC Microsoft Access 驱动程序] INSERT INTO 语句的语法错误。
错误原因:Microsoft OLE DB Provider for ODBC Drivers
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/2/list.asp, 第 68 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) [em10]
<%
dim conn
set conn=server.CreateObject("adodb.connection")
conn.open "www"
if conn.state=1 then
response.Write "数据库连接成功"
elseif conn.state=0 then
response.Write "数据库没有连接成功"
end if
dim strsql,values
dim n1,a1,p1,t1,s1,e1,m1
n1=request("name")
a1=request("address")
p1=request("person")
t1=request("tel")
s1=request("start_date")
e1=request("end_date")
m1=request("money")
if request("name")="" or request("tel")="" then
strsql="insert into kehu (name,address,person,tel,start_date,end_date,money) values('"+n1+"','"+a1+"','"+p1+"','"+t1+"','"+s1+"','"+e1+"','"+m1+"')"
conn.execute(strsql)
end if
if conn.errors.count>0 then
response.Write "保存过程中发生错误,必须重新填写"
else
response.Write "<p>姓名:"& name
end if
dim i,err
for i=1 to conn.errors.count
set err=conn.errors.item(i-1)
response.Write "错误描述:"& err.description & "<br>"
response.Write "错误原因:" & err.source & "<br>"
next
数据库已经连接成功。
错误描述:[Microsoft][ODBC Microsoft Access 驱动程序] INSERT INTO 语句的语法错误。
错误原因:Microsoft OLE DB Provider for ODBC Drivers
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/2/list.asp, 第 68 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) [em10]