CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

第一次用sql做数据库,不知道这个问题的原因,请帮忙!

楼主teddyboy98()2004-05-03 19:13:37 在 Web 开发 / ASP 提问

<!--#include   file="conn.inc"-->  
  <%  
  if   not   isempty(request.Form("a1"))   then  
  ch=request.Form("ch")  
  ylf=request.Form("ylf")  
  sf=request.Form("sf")  
  glf=request.Form("glf")  
  chyyzzj=request.Form("chyyzzj")  
  yp=request.Form("yp")  
  hfy=request.Form("hfy")  
  qt=request.Form("qt")  
  conn.execute   "insert   into   jcxx(ch,ylf,sf,glf,chyyzzj,yp,hfy,qt)    
   
  values('"&ch&"','"&ylf&"','"&sf&"','"&glf&"','"&chyyzzj&"','"&   yp   &"','"&   hfy   &"','"&qt&"')"  
  end   if  
  %>  
   
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <title>无标题文档</title>  
  <script   id=clienteventhandlersjs   language="JavaScript">  
  <!--  
  function   ylf_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   sf_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   glf_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   zj_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   yp_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   hfy_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  function   qt_onkeypress(){  
  var   passflag  
  passflag=true  
  if   (window.event.keycode<48   ||window.event.keycode>57)  
  {  
  passflag=false  
  }  
  if(window.event.keycode==46)  
  {  
  passflag=true  
  }  
  return   passflag  
  }  
  //-->  
  </script>  
  </head>  
   
  <body>  
  <form     method="post"   action="add.asp">  
      <table   width="75%"   border="0"   cellpadding="0"   cellspacing="0">  
          <tr>    
              <td   colspan="4"><div   align="center"><%     response.write   TheMessage     %></div></td>  
          </tr>  
          <tr>    
              <td   width="15%"><div   align="right">车号</div></td>  
              <td   width="28%"><input   name="ch"   type="text"   id="ch"></td>  
              <td   width="18%"><div   align="right">租金</div></td>  
              <td   width="39%"><input   name="chyyzzj"   type="text"   id="chyyzzj"   language=javascript   onKeyPress="return    
   
  chyyzzj_onkeypress()">  
                  元</td>  
          </tr>  
          <tr>    
              <td><div   align="right">养路费</div></td>  
              <td><input   name="ylf"   type="text"     id="ylf"   language=javascript   onkeypress="return   ylf_onkeypress()">  
                  元</td>  
              <td><div   align="right">月票</div></td>  
              <td><input   name="yp"   type="text"     id="yp"   language=javascript   onkeypress="return   yp_onkeypress()">  
                  元</td>  
          </tr>  
          <tr>    
              <td><div   align="right">税费</div></td>  
              <td><input   name="sf"   type="text"     id="sf"   language=javascript   onkeypress="return   sf_onkeypress()">  
                  元</td>  
              <td><div   align="right">还费用</div></td>  
              <td><input   name="hfy"   type="text"     id="hfy"   language=javascript   onkeypress="return   hfy_onkeypress()">  
                  元</td>  
          </tr>  
          <tr>    
              <td><div   align="right">管理费</div></td>  
              <td><input   name="glf"   type="text"     id="glf"   language=javascript   onkeypress="return   glf_onkeypress()">  
                  元</td>  
              <td><div   align="right">其他</div></td>  
              <td><input   name="qt"   type="text"     id="qt"   language=javascript   onkeypress="return   qt_onkeypress()">  
                  元</td>  
          </tr>  
          <tr>    
              <td   colspan="2">             
                  <input   name="a1"   type="submit"   id="a1"   value="确定"   ></td>  
              <td   colspan="2">               
                  <input   name="a2"   type="submit"   id="a2"   value="提交"   onClick="javascript:form1.reset()"></td>  
          </tr>  
      </table>  
      <p>&nbsp;</p></form>  
  </body>  
  </html>  
  <script   language="VBScript">  
  <!--  
  function   isnum()  
  isnum=false  
  if   isnumeric(form1.ylf.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.sf.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.glf.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.zj.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.yp.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.hfy.value)   then  
  isnum=true  
  end   if  
  if   isnumeric(form1.qt.value)   then  
  isnum=true  
  end   if  
  if   isnum=false   then  
  msgbox"请检查输入的数据类型是否是数字!"  
  end   if  
  end   function  
  //-->  
  </script>  
  Microsoft][ODBC   SQL   Server   Driver][SQL   Server]不允许从数据类型   varchar   到数据类型   money   的隐性转换(表   'YH.dbo.jcxx',列   'ylf')。请使用   CONVERT   函数来运行此查询。    
  问题点数:20、回复次数:2Top

1 楼skyboy0720(曲终人散)回复于 2004-05-03 19:21:01 得分 10

你ylf里的值是什么Top

2 楼liuyangxuan(阿轩)回复于 2004-05-03 19:28:51 得分 10

将数据库里的money型字段改成varchar即可!  
  因为您的SQL语句是以字符型插入的,而你的库字段是money型  
  所以提示不允许隐性转换。Top

相关问题

  • ((( SoS ))) 如何知道SQL数据库异常产生的原因
  • SQL 数据库
  • sql数据库
  • SQL数据库
  • 如何知道一个sql数据库是本地的数据库
  • ASP+SQL数据库
  • 有谁知道 cycle 这种数据库吗?是不是 sql
  • 学数据库,不知道学Oracle还是学SQL Server
  • 数据库转为SQL后,以下代码有个别字段无法写入数据库?什么原因?
  • 谁知道:发行后,数据库不需另装平台的中大型数据库?Sybase SQL anywhere可以吗?

关键词

得分解答快速导航

  • 帖主:teddyboy98
  • skyboy0720
  • liuyangxuan

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo