我现在想把下面这些数据写到表中。。
form_main.Dconnect.Execute (
       'insert into ryxx(ryid,bmbh,rybh,ryxm,rfkh,rfye,rfzt,khrq,yj) values('''
       +inttostr(form_zh_xz.stringApartname) +''','''   //人员id
       +form_zh_xz.stringApartname2 +''','''   //部门编号
       +form_zh_xz.stringApartname1 +''','''   //人员编号
       +form_zh_xz.stringApartname0 +''','''   //人员姓名
       +form_zh_xz.stringApartname3 +''','''  //卡号
       +formatfloat('#,##0.00',strtofloat(form_zh_xz.edit5.Text)) + ''','''   //余额
       +inttostr(32) +''','''                           //人员卡的状态 
       +timetostr(now)+''','''                           //发卡时间 即是此时电脑的时间
       +formatfloat('#,##0.00',strtofloat(form_zh_xz.edit4.Text))+''')');  // 押金
stringApartname为integer tringApartname2/0/1/3string类型 但是因为我的数据库表的
rfye yj 为money类型 怎么转换??我觉得我写的是错的edit5.Text为文本
还有时间timetostr(now)好像全错了 求高人写好下

解决方案 »

  1.   

    FormatFloat('0.00',strtofloat(form_zh_xz.edit5.Text)) 
    DateTimeToStr(now)+
      

  2.   

    为什么老是报错说什么 不能varchar到money的隐形转换呢 求救!!
    怎么办 怎么处理 应该有方法吧 很正常的我们在edit中输入数字 其实是金钱
    数据库中的这个字段是money类型啊
    怎么转FormatFloat('0.00',strtofloat(form_zh_xz.edit5.Text)) ??不行吗??
      

  3.   

    ADOQuery1.Close;
          ADOQuery1.SQL.Clear;
          ADOQuery1.SQL.Add('insert into ryxx(ryid,bmbh,rybh,ryxm,rfkh,rfye,rfzt,khrq,yj) values('+
           '(:ryid,:bmbh,:rybh,:ryxm,:rfkh,:rfye,:rfzt,:khrq,:yj)');
           ADOQuery1.Parameters.ParamByName('ryid').Value:=form_zh_xz.stringApartname;
           ADOQuery1.Parameters.ParamByName('bmbh').Value:=form_zh_xz.stringApartname2;
           ADOQuery1.Parameters.ParamByName('rybh').Value:=form_zh_xz.stringApartname1;
           ADOQuery1.Parameters.ParamByName('ryxm').Value:=form_zh_xz.stringApartname0;
           ADOQuery1.Parameters.ParamByName('rfkh').Value:=form_zh_xz.stringApartname3;
           ADOQuery1.Parameters.ParamByName('rfye').Value:=formatfloat('#,##0.00',strtofloat(form_zh_xz.edit5.Text));
           ADOQuery1.Parameters.ParamByName('rfzt').Value:=32;
           ADOQuery1.Parameters.ParamByName('khrq').Value:=now();
           ADOQuery1.Parameters.ParamByName('yj').Value:=formatfloat('#,##0.00',strtofloat(form_zh_xz.edit4.Text));
          ADOQuery1.ExecSQL;