Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphiµ¼³öºó³¤Êý¾ÝÏÔʾ²»È«

Delphi(Pascal) code:

procedure Tpaigon.N2Click(Sender: TObject);
var
j,col:integer;
filename:string;
MSExcel,xlsheet,xlBook:Variant; //ole ComObj
begin
IF DBGrid1.Fields[0].AsString='' then
begin
Application.MessageBox('ÁбíΪ¿Õ£¬ÎÞ·¨µ¼³ö£¡','´íÎó²Ù×÷',MB_OK+MB_ICONError);
exit;
end;
//µ¼³öÊý¾Ý
SaveDialog1.FileName:='ÅɳöÐÅÏ¢';
if SaveDialog1.Execute then
begin
filename := concat(SaveDialog1.FileName,'.xls');
try
MSExcel:=CreateOLEObject('Excel.Application');
xlBook:=MSExcel.WorkBooks.Add;
xlsheet:=xlBook.Worksheets['sheet1'];
for col:=1 to DBgrid1.Columns.Count do
begin
xlsheet.Cells.item[1,col]:=DBgrid1.Columns[col-1].Title.Caption;
j:=1;
adoquery1.First;
while not ADOQuery1.Eof do begin
DBGrid1.SelectedRows.CurrentRowSelected:=True;
xlsheet.Cells.item[j+1,col]:=DBGrid1.Fields[col-1].AsString;
ADOQuery1.Next;
j:=J+1;
end;
end;
xlBook.SaveAs(filename);
MSExcel.WorkBooks.close;
MSExcel.Quit;
MSExcel:=unassigned;

except
Application.Messagebox('ExcelûÓа²×°!','´íÎóÌáʾ',MB_ICONERROR+mb_Ok);
exit;
end;
end;
end;




ÉÏÃæÊÇ´úÂë,µÃÔÚÄÄÀï¼ÓÉÏÒ»¾äÉèÖÃÁÐΪÎı¾Ð͵ÄÓï¾ä....°ÑÁÐÀà±ð¸Ä³ÉÎı¾Ðͺó


Ïà¹ØÎÊ´ð£º

ACCESSµÄ×Ô¶¨Ò庯ÊýÔÚdelphiÀïÔõôÓÃÄØ...

ÎÒÔÚÄ£¿éÀï×Ô¶¨ÒåÁËÒ»¸öº¯Êý:stradd()

¿ÉÊÇÔÚadoquery1.sql.add('select stradd(author) from book');
ʱÌáʾstradd䶨Òå...

Õâ¸öÎÊÌâÓÐʲô°ì·¨¿ÉÒÔ½â¾öµÄÂð? ·Ç³£¸Ð¼¤!


(ÔÚA ......

delphi Ctrl+×ó¼ü ÎÞ·¨²é¿´ windows.pas Ôõô°ì

ÎÒ°²×°µÄÊÇÆóÒµ°æ¡£¡£¡£ 
ÎÒÎÊÏ£¬ CTRL+×ó¼ü Äܲ鿴 windows.pas Âð£¿
¾ÍÊÇ ½Ó¿ÚÀïµÄwindows¡£

µ±È»¿ÉÒÔ,CTRL+×ó¼üµã»÷Interface²¿·ÖµÄWindows¾Í¿ÉÒÔÁË

ɶɶÆóÒµ°æ£¿È¥°²×°Ä¿Â¼¿´¿´libÎļþ¼ÐÏÂÓÐÃ»Ó ......

delphi Òì²½Ïß³Ì

delphi Òì²½Ïß³ÌÔõôÔõôʵÏÖ£¿
Çë¸÷λ´óÀаï棡
×îºÃÓиöʵÀý£¡
¶àл

Ä㲻ͬ²½¾ÍÊÇÒì²½ÁË,»¹Ð´É¶

ĬÈÏÇé¿öÏ£¬Ï߳̾ÍÊÇÒì²½µÄ¡­¡­¡­¡­*^_^*

¹À¼ÆÂ¥Ö÷ͬ²½ºÍÒì²½¸ÅÄûŪÇå

ÕæÎÞÓï¡£¡£¿É ......

DelphiÔõÑùÏÔʾÍøÒ³µÄÒ»²¿·Ö

Delphi
  ÔõÑù»ñÈ¡ÍøÒ³²¿·ÖÄÚÈÝ£¨´úÂ룩£¬²¢ÇÒÏÔʾ³öÀ´£¡
£¨Ö»ÊÇÍøÒ³ÀïÃæµÄÒ»²¿·ÖÄÚÈݲ¢²»ÊÇÈ«²¿£©
ûŪ¶®£¡

ÀàËÆwebseverµÄ¹¦ÄÜ£¿
¹À¼ÆÊÇÀûÓÃieµÄ½Ó¿Ú¡£¡£¡£¡£¡£¡£¡£¡£

ÊÇÀàËÆwebseverµÄ¹¦ÄÜ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ