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

VBÏÂEXECLµÄ²Ù×÷·½·¨

È«Ãæ¿ØÖÆ Excel
Ê×ÏÈ´´½¨ Excel ¶ÔÏó£¬Ê¹ÓÃComObj:
Dim ExcelID as Excel.Application
Set ExcelID as new Excel.Application
1) ÏÔʾµ±Ç°´°¿Ú£º
ExcelID.Visible := True;
2) ¸ü¸Ä Excel ±êÌâÀ¸£º
ExcelID.Caption := 'Ó¦ÓóÌÐòµ÷Óà Microsoft Excel';
3) Ìí¼Óй¤×÷²¾£º
ExcelID.WorkBooks.Add;
4) ´ò¿ªÒÑ´æÔڵŤ×÷²¾£º
ExcelID.WorkBooks.Open( 'C:\Excel\Demo.xls' );
5) ÉèÖõÚ2¸ö¹¤×÷±íΪ»î¶¯¹¤×÷±í£º
ExcelID.WorkSheets[2].Activate;
»ò ExcelID.WorkSheets[ 'Sheet2' ].Activate;
6) ¸øµ¥Ôª¸ñ¸³Öµ£º
ExcelID.Cells[1,4].Value := 'µÚÒ»ÐеÚËÄÁÐ';
7) ÉèÖÃÖ¸¶¨ÁеĿí¶È£¨µ¥Î»£º×Ö·û¸öÊý£©£¬ÒÔµÚÒ»ÁÐΪÀý£º
ExcelID.ActiveSheet.Columns[1].ColumnsWidth := 5;
8) ÉèÖÃÖ¸¶¨Ðеĸ߶ȣ¨µ¥Î»£º°õ£©£¨1°õ£½0.035ÀåÃ×£©£¬ÒÔµÚ¶þÐÐΪÀý£º
ExcelID.ActiveSheet.Rows[2].RowHeight := 1/0.035; // 1ÀåÃ×
9) ÔÚµÚ8ÐÐ֮ǰ²åÈë·ÖÒ³·û£º
ExcelID.WorkSheets[1].Rows[8].PageBreak := 1;
10) ÔÚµÚ8ÁÐ֮ǰɾ³ý·ÖÒ³·û£º
ExcelID.ActiveSheet.Columns[4].PageBreak := 0;
11) Ö¸¶¨±ß¿òÏß¿í¶È£º
ExcelID.ActiveSheet.Range[ 'B34' ].Borders[2].Weight := 3;
1-×ó 2-ÓÒ 3-¶¥ 4-µ× 5-б( \ ) 6-б( / )
12) Çå³ýµÚÒ»ÐеÚËÄÁе¥Ôª¸ñ¹«Ê½£º
ExcelID.ActiveSheet.Cells[1,4].ClearContents;
13) ÉèÖõÚÒ»ÐÐ×ÖÌåÊôÐÔ£º
ExcelID.ActiveSheet.Rows[1].Font.Name := 'Á¥Êé';
ExcelID.ActiveSheet.Rows[1].Font.Color := clBlue;
ExcelID.ActiveSheet.Rows[1].Font.Bold := True;
ExcelID.ActiveSheet.Rows[1].Font.UnderLine := True;
14) ½øÐÐÒ³ÃæÉèÖãº
a.ҳü£º
ExcelID.ActiveSheet.PageSetup.CenterHeader := '±¨±íÑÝʾ';
b.Ò³½Å£º
ExcelID.ActiveSheet.PageSetup.CenterFooter := 'µÚ&Ò³';
c.ҳüµ½¶¥¶Ë±ß¾à2cm£º
ExcelID.ActiveSheet.PageSetup.HeaderMargin := 2/0.035;
d.Ò³½Åµ½µ×¶Ë±ß¾à3cm£º
ExcelID.ActiveSheet.PageSetup.HeaderMargin := 3/0.035;
e.¶¥±ß¾à2cm£º
ExcelID.ActiveSheet.PageSetup.TopMargin := 2/0.035;
f.µ×±ß¾à2cm£º
ExcelID.ActiveSheet.PageSetup.BottomMargin := 2/0.035;
g.×ó±ß¾à2cm£º
ExcelID.ActiveSheet.PageSetup.LeftMargin := 2/0.035;
h.Óұ߾à2cm£º
ExcelID.ActiveSheet.PageSetup.RightMargin := 2/0.035;
i.Ò³Ãæˮƽ¾ÓÖУº
ExcelID.ActiveSheet.PageSetup.Cent


Ïà¹ØÎĵµ£º

vb Á¬½ÓAccess×Ö·û´®¡¢vbÁ¬½ÓDb2µÄ×Ö·û´®

DB2ConnectionString
b2str = "Provider=MSDASQL.1;Password=a$sk6G7;Persist Security Info=True;User ID=DBA;Data Source=ConDB2SFXXK"
AccessConnectonString
accessstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DMSJK.mdb;Jet OLEDB:database password=" ......

VB StrConvº¯Êý

StrConvº¯Êý
·µ»Ø°´Ö¸¶¨ÀàÐÍת»»µÄ Variant (String)¡£
Óï·¨
StrConv(string, conversion, LCID)
StrConv º¯ÊýµÄÓï·¨ÓÐÏÂÃæµÄÃüÃû²ÎÊý£º
²¿·Ö
˵Ã÷
string
±ØÒª²ÎÊý¡£Òª×ª»»µÄ×Ö·û´®±í´ïʽ¡£
conversion
±ØÒª²ÎÊý¡£Integer¡£ÆäÖµµÄºÍ¾ö¶¨×ª»»µÄÀàÐÍ¡£
LCID
¿ÉÑ¡µÄ¡£Èç¹ûÓëϵͳLocaleID²»Í¬£¬ÔòΪLocaleID£¨ÏµÍ³ ......

ÈçºÎÓÃVBд°²È«¿Ø¼þ

×ÜÊö
±¾ÎÄÐðÊöÁËÈçºÎÔÚVBÖÐʵÏֿؼþµÄIobjectSafety½Ó¿Ú£¬ÒÔ±êÖ¾¸Ã¿Ø¼þÊǽű¾°²È«ºÍ³õʼ»¯°²È«µÄ¡£VB¿Ø¼þĬÈϵĴ¦Àí·½Ê½ÊÇÔÚ×¢²á±íÖÐ×¢²á×é¼þÀàÀ´±êʶÆ䰲ȫÐÔ£¬µ«ÊµÏÖIobjectSafety½Ó¿ÚÊǸüºÃµÄ·½·¨¡£±¾ÑÔÓï°üÀ¨ÁËʵÏÖ¹ý³ÌÖÐËùÐèµÄËùÓдúÂë¡£
Çë×¢Ò⣬¿Ø¼þÖ»ÓÐȷȷʵʵÊÇ°²È«µÄ£¬²ÅÄܱ»±êʶΪ“°²È«µÄ”¡£±¾ ......

΢ÐÍORM——ÓÃVBºÍC#±àдµÄ¶¯Ì¬ÀàÐÍORM

      ½üÀ´ORM±äµÃÔ½À´Ô½Æձ飬Õⶼ¹éÓÚÒ»Öֺܾß˵·þÁ¦µÄÔ­Òò£»Ëü¿ÉÒÔʹ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÓ¦ÓóÌÐò±äµÃ¸ü¿ì¡¢¸üÊ¡Á¦¡£µ«ÊÇORM¿ò¼Ü¶¼Óе㓹ÌÖ´¼º¼û”£¬ËûÃÇÆÚÍû¿ª·¢Õß×ñ´ÓÌض¨µÄ¹æÔò£¬µ±¹æÔò±»´òÆƵÄʱºò¾Í·Ç³£ÄÑÒÔʹÓá£×îͨ³£µÄ¹æÔòÖ®Ò»¾ÍÊÇ£¬´æ´¢¹ý³Ì±ØÐë×ÜÊÇ·µ»Øµ¥¶ÀµÄ½á¹û¼¯£¬ÆäÖд ......

VB Ïß³Ì ÕæµÄ²»ÐÐ

Ò»¿ªÊ¼ ÒÔΪVBµÄÏß³Ì ²»ÊÇÏñÍøÉÏÈË˵µÄÄÇô´àÈõ¡£¡£¡£°¥ ÏÖÔÚÁìÂÔµ½ÁË¡£¡£¡£VPrivate Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long
Pri ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ