当前位置:编程学习 > C#/ASP.NET >>

asp关于insert into的问题

<%
 dim strSql,rs
 dim usersname,password ,systime,dtmTest,dtmEnd 
 Dim I,err   
usersname  =request.Form("usersname")
password  =request.Form("password")
systime=cdate(now())
   dtmEnd=cdate("2010-8-31 11:55:33") 
if usersname  <> "" and password  <> "" then
if  systime>dtmEnd  then  
strsql="insert into  db_user_password where name='" & usersname & "'and password=" & password 
else 
strsql="insert into db_user_password1 where name='" & usersname & "'and password=" & password 
end if
 conn.Execute(strSql)

if  conn.Errors.Count<1 then
 response.Write("添加用户成功!")
'else
'For I =0 To conn.Errors.Count-1 '循环输出所有的错误对象
'Set err=conn.Errors.Item(I) '建立Error对象err
'Response.Write "错误编号:" & err.Number & "<br>"
'Response.Write "错误描述:" & err.Description & "<br>"
'Response.Write "错误原因:" & err.Source & "<br>"
'Response.Write "提示文字:" & err.HelpContext & "<br>"
'Response.Write "帮助文件:" & err.HelpFile & "<br>"
'Response.Write "原始错误:" & err.NativeError & "<br>"
'response.Write  strsql
'Next
end if
end if
%>
以上为主要代码
问题就是当为insert into时不执行语句,而当时delete from时却可以执行,很郁闷!希望好心的大大帮忙解决下,不甚感激! --------------------编程问答-------------------- insert into TableName(Col1,Col2) values(val1,val2) --------------------编程问答-------------------- 你的insert into 有问题
怎么只有插入表,没有值呀 --------------------编程问答--------------------
引用 2 楼 maco_wang 的回复:
你的insert into 有问题
怎么只有插入表,没有值呀


insert into TableName(Col1,Col2) values(val1,val2)
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,