aq3.Close;
      aq3.SQL.Clear;
      aq3.SQL.Add('insert into xggl_cprecord(ptype,sno,sname,classno,dname,ctype,cname,clever,clevername,Ioffice,Querykey,printcount,confirm,pno) values ');
      aq3.SQL.Add('(0,'''+fdb.split(str,'_').aa[2]+''','''+fdb.split(str,'_').aa[1]+''','''+trim(aq2.fieldbyname('classno').AsString)+''','''+trim(aq2.FieldByName('dname').AsString)+'''');
      aq3.SQL.Add(','''+trim(combobox2.Text)+''','''+trim(labelededit1.Text)+''','''+clever+''','''+trim(combobox3.Text)+''',南昌航空大学,'''+fdb.getquerykey()+''','''+fdb.u.userid+''')');
      if  combobox3.Text='优秀(特等奖)' then
       begin
              //怎样写这个值?clever要做判断
       end;
       if  combobox3.Text='普通(一等奖)' then
       begin
              //怎样写这个值?
       end;
       if  combobox3.Text='二等奖' then
       begin       end;
       if  combobox3.Text='三等奖' then
       begin       end;
       if  combobox3.Text='四等奖' then
       begin       end;

解决方案 »

  1.   

    就是那个插入了那个combobox3.Text的值之后,就会往相应的clever这个字段里面插入一个int型的数值。
      

  2.   

    还是没说明白啊,楼主,
    你的意思是,下拉框的每个值对应一个数字,这个数字就是往数据库里存储?
    你可以使用存储combobox1.itemindex;
    还你的程序还有个错误,celver字段拼接字符串两头不能有‘’
      

  3.   

    在aq3.SQL.Clear;这句之前处理clever值。如:case combobox3.ItemIndex of
      0: clever := 值1;
      1: clever := 值2;
      2: clever := 值3;
    end;然后:
    aq3.SQL.Clear;
    aq3.SQL.Add(.....);