急“insert”问题

dwxq 2002-09-18 12:01:20
请各位看看我的代码写的正确吗?谢谢
<%
set conn=server.createobject("adodb.connection")
conn.open "test","sa"
set rs=server.createobject("adodb.recordset")
strsql="insert into jibenbiao(xingming,xingbie,chushengnianyue,dengluriqi,minzu,hunyinzhuangkuang,zhengzhimianmao,shengao,tizhong,zhaopian,huji,juzhudi,xiangongzuodi,jiankangzhuangkuang,jishuzhiwu,zhiyezige) values('"&thename&"','"&thesex&"','"&thedate&"','"&thehidden&"','"&thenationality&"','"&themar&"','"&thefeatures&"','"&theheight&"','"&theweight&"','"&thesex&"','"&thenativation&"','"&theplace&"','"&theworkplace&"','"&thehealth&"','"&thepost&"','"&thetitle&"')"
conn.execute(strsql)
%>
...全文
82 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dnyz 2002-09-18
  • 打赏
  • 举报
回复
可能是字符串过长了,你试试将整个sql语句分开作为几个字符串来连接到一个变量中,如:

strsql="......"
strsql=strsql & "............."
flashasp 2002-09-18
  • 打赏
  • 举报
回复
set conn=server.createobject("adodb.connection")
conn.open "test","sa"

->

DbPath = SERVER.MapPath("xxx.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=xxx.mdb;" & _
"Uid=test;" & _
"Pwd=sa"

dwxq 2002-09-18
  • 打赏
  • 举报
回复
放到查询分析器里试过了,语法正确,但执行就报错。
lanying 2002-09-18
  • 打赏
  • 举报
回复
Please output "strsql" with "Response.Write" first.
qiangtian 2002-09-18
  • 打赏
  • 举报
回复
把这个语句放到查询分析器里试试不就行了

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧