delphi7+sql2000+adotable我在sql2000创建了一个表表名和字段如下: 
表名 people 
字段:   类型 
name     char 
xingbie  char 
size     int 
page     image 
我用一个窗体实现天加信息分别用了3个edit和一个image控件来接收输入的信息!我的代码实现是 
with adotable1 do 
begin 
disablecontrols; 
appendrecord([edit1.text,edit2.text,chrtoint(edit3.text),null]); 
enablecontrols; 
end; 
然后在用其他代码将图片天加到page 字段中, 
我觉得这样做太麻烦而且结构不紧凑 
请问各位高手怎样才能用一条appendrecord([]);语句将全部个人信息天加到表中啊? 还有一个问题是我为什么用delete语句删除不了表中的记录啊? 以上问题请高手指教!谢谢! 

解决方案 »

  1.   

    首先name和xingbie的数据类型最好选用Vchar,将图片添加到数据库中用loadfromfile命令,所以不能用Append指令
      

  2.   

    1.你还不如直接用db组件不就行了.
    2.你在删除语句后用showmessage('sdf')看一下语句执行了没有.
      

  3.   

    方法有无数种啊;
    用ADODATASET,
        begin
    adodataset1.append
    adodataset1.getfieldbyname['aaa'].text=varible1;
    ;;;;
    adodataset.post;
    //或者,直接用adoconnection
    sqlstr='insert into table values('','')......';插入
    sqlstr='delete from table1 where id=1';删除
    adoconnection1.execute(sqlstr);
    //或者,用adoquery
    。。
    end;
      

  4.   

    我建议用insert into 
    删除记录用delete from table啦!