insert into语句的语法错误。。 用的是ASP和ACCESS
<%IfRequest.Form("book")<>""AndRequest.Form("author")<>""Thenbook=Request.Form("book"...
<%
If Request.Form("book")<>"" And Request.Form("author")<>"" Then
book=Request.Form("book")
author=Request.Form("author")
If Request.Form("price")<>"" Then
price=Request.Form("price")
Else
price=0
End If
txtcalss=Request.Form("class")
publish=Request.Form("publish")
photo=Request.Form("photo")
num=Request.Form("num")
txtIntro=Request.Form("memo")
Dim conn,strConn
Set conn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/db1.mdb")
conn.Open strConn
Dim strSql
strSql="Insert Into Book(book,author,price,class,publish,photo,num,memo) Values('" & book & "','" & author & "'," & price & ",'" & txtclass & "','" & publish & "','" & photo & "'," & num & ",'" & txtIntro & "')"
conn.Execute(strSql)
Response.Redirect "update_form.asp"
End If
%>
系统说 conn.Execute(strSql) 这行错误,请各位大虾帮忙解决下,谢谢 展开
If Request.Form("book")<>"" And Request.Form("author")<>"" Then
book=Request.Form("book")
author=Request.Form("author")
If Request.Form("price")<>"" Then
price=Request.Form("price")
Else
price=0
End If
txtcalss=Request.Form("class")
publish=Request.Form("publish")
photo=Request.Form("photo")
num=Request.Form("num")
txtIntro=Request.Form("memo")
Dim conn,strConn
Set conn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/db1.mdb")
conn.Open strConn
Dim strSql
strSql="Insert Into Book(book,author,price,class,publish,photo,num,memo) Values('" & book & "','" & author & "'," & price & ",'" & txtclass & "','" & publish & "','" & photo & "'," & num & ",'" & txtIntro & "')"
conn.Execute(strSql)
Response.Redirect "update_form.asp"
End If
%>
系统说 conn.Execute(strSql) 这行错误,请各位大虾帮忙解决下,谢谢 展开
3个回答
展开全部
这句改为
strSql="Insert Into Book(book,author,price,class,publish,photo,num,memo) Values('" & book & "','" & author & "','" & price & "','" & txtclass & "','" & publish & "','" & photo & "','" & num & "','" & txtIntro & "')"
strSql="Insert Into Book(book,author,price,class,publish,photo,num,memo) Values('" & book & "','" & author & "','" & price & "','" & txtclass & "','" & publish & "','" & photo & "','" & num & "','" & txtIntro & "')"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
电话号码不是字符型吧.还有NIM等 如果不是就不要用引号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-07-09
展开全部
strSql
把这个打印出来看下sql语句有没有问题
把这个打印出来看下sql语句有没有问题
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询