| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 452 人关注过本帖
标题:插入错误,继续
取消只看楼主 加入收藏
xiaohonghui0
Rank: 1
等 级:新手上路
威 望:1
帖 子:274
专家分:0
注 册:2006-4-10
收藏
 问题点数:0 回复次数:0 
插入错误,继续

<%

if(request.form("textfield") <> "") then Command1__textfield = request.form("textfield")

if(request.form("textfield5") <> "") then Command1__textfield5 = request.form("textfield5")

if(request.form("textfield6") <> "") then Command1__textfield6 = request.form("textfield6")

if(request.form("textfield7") <> "") then Command1__textfield7 = request.form("textfield7")

if(request.form("textfield4") <> "") then Command1__textfield4 = request.form("textfield4")

if(request.form("textfield8") <> "") then Command1__textfield8 = request.form("textfield8")

if(request.form("textfield9") <> "") then Command1__textfield9 = request.form("textfield9")

if(request.form("textfield10") <> "") then Command1__textfield10 = request.form("textfield10")

if(request.form("textfield11") <> "") then Command1__textfield11 = request.form("textfield11")

if(request.form("textfield12") <> "") then Command1__textfield12 = request.form("textfield12")

if(request.form("textfield3") <> "") then Command1__textfield3 = request.form("textfield3")

if(request.form("textfield2") <> "") then Command1__textfield2 = request.form("textfield2")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_iemm_STRING
Command1.CommandText = "INSERT INTO student (name, address, number, class, borndate, year, fromdate, math, english, chinese, lincenumber, sex) VALUES (" + Replace(Command1__textfield, "'", "''") + "," + Replace(Command1__textfield5, "'", "''") + "," + Replace(Command1__textfield6, "'", "''") + "," + Replace(Command1__textfield7, "'", "''") + "," + Replace(Command1__textfield4, "'", "''") + "," + Replace(Command1__textfield8, "'", "''") + "," + Replace(Command1__textfield9, "'", "''") + "," + Replace(Command1__textfield10, "'", "''") + "," + Replace(Command1__textfield11, "'", "''") + "," + Replace(Command1__textfield12, "'", "''") + "," + Replace(Command1__textfield3, "'", "''") + "," + Replace(Command1__textfield2, "'", "''") + " ) "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
运行说是我的insert语句错误,是Command1.Execute()处,大家帮我看看

2006-05-16 12:29
快速回复:插入错误,继续
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020611 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved