我现在用了一个Query控件加上一个SQL句语连上了数据库里的test表,当我要点击一个按钮时,就可以把test表里的内容导出来,请问怎么写这条代码?
还有要注意的是,在test表里有部分的字段是MEMO类型的,要怎么样转化这个字段啊?
请大家帮一下忙,谢谢!

解决方案 »

  1.   

    var 
      SomeFiled : String;
    Query.close;
    Query.SQL.clear;
    Query.Sql.Text := 'select * from test';
    Query.Open;
    Query.First;
    while not Query.Eof do 
      begin
        SomeFiled  := Query.FieldByName('sfield').AsString; //取某条记录某个字段的值
        Query.Next;
      end;
      

  2.   

    [Pascal Error] Unit1.pas(1): Unable to invoke Code Completion due to errors in source code
    在设Query.的时候提示了这个错误??
      

  3.   

    还有,Delphi(Pascal) code你所保存后的路径在哪里啊?能不能保存为xls格式