如题所问,在线等待,谢谢!!

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/3015/3015187.xml?temp=.4298059
    http://community.csdn.net/Expert/topic/2892/2892758.xml?temp=.2671778
      

  2.   

    系统环境: 
    1、操作系统:Windows 2000 Server,机器内存128M 
    2、数据库: Oracle 8i R2 (8.1.6) for NT 企业版 
    3、安装路径:C:\ORACLE 
    实现步骤: 
    1、打开MicroSoft Excel 2000 
    2、文件(F)→新建(N)→工作簿→ 
    3、输入以下数据,存盘为test.xls,如图: 
    4、文件(F)→另存为(A)→ 
    保存类型为:制表符分隔,起名为text.txt,保存到C:\ 
    5、连入SQL*Plus 
    以system/manager用户登录, 
    SQL> conn system/manager 
    创建表结构 
    SQL> create table test 
        ( 
        id       number,        --序号 
        username    varchar2(10),     --用户名 
        password    varchar2(10),     --密码 
        sj       varchar2(20)      --建立日期 
        ); 
    6、创建SQL*Loader输入数据所需要的文件,均保存到C:\,用记事本编辑: 
    控制文件:input.ctl,内容如下: 
      load data           --1、控制文件标识 
      infile 'test.txt'       --2、要输入的数据文件名为test.txt 
      append into table test    --3、向表test中追加记录 
      fields terminated by X'09'  --4、字段终止于X'09',是一个制表符(TAB) 
      (id,username,password,sj)   -----定义列对应顺序 
    a、insert,为缺省方式,在数据装载开始时要求表为空 
    b、append,在表中追加新记录 
    c、replace,删除旧记录,替换成新装载的记录 
    d、truncate,同上 
    7、在DOS窗口下使用SQL*Loader命令实现数据的输入 
    C:\>sqlldr userid=system/manager control=input.ctl 
      

  3.   

    我记得有源码给你的呀 怎么没了?
    我昨天下午给你发过的unit Unit6;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      ComObj, StdCtrls, Grids;type
      TForm1 = class(TForm)
        StringGrid1: TStringGrid;
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;  procedure SGridToExcel(SGrid: TStringGrid; ExcelFileName: String);var
      Form1: TForm1;implementation{$R *.DFM}procedure SGridToExcel(SGrid: TStringGrid; ExcelFileName: String);
    var
      ExcelApp,
      WorkSheet: Variant;  i,j: Integer;
    begin
      try
        ExcelApp  := CreateOLEObject('Excel.Application');
        WorkSheet := CreateOLEObject('Excel.Sheet');
      except
        ShowMessage('  提示:您尚未安装 Microsoft Excel 或其不可用!  ');
        exit;
      end;  WorkSheet := ExcelApp.WorkBooks.Add;  for i := 0 to SGrid.RowCount - 1 do
      begin
        for j := 0 to SGrid.ColCount - 1 do
        begin
          ExcelApp.Cells[i+1,j+1] := SGrid.Cells[i,j];
        end;
      end;  WorkSheet.SaveAs(ExcelFileName);
      WorkSheet.Close;  ExcelApp.Quit;
      ExcelApp := UnAssigned;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      SGridToExcel(StringGrid1,'D:\demo.xls');end;procedure TForm1.Button2Click(Sender: TObject);var
      I, J, K : Integer;
    begin
      K := 0;
      with StringGrid1 do
      begin
        for I := 0 to ColCount - 1 do
        begin
          for J:= 0 to RowCount - 1 do
          begin
            K := K + 1;
            Cells[I,J] := IntToStr(K);
          end;
        end;
      end;
    end;end.