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

DELPHIÖвÙ×÷ACCESSÊý¾Ý¿â

DELPHIÖвÙ×÷ACCESSÊý¾Ý¿â(½¨Á¢.mdbÎļþ,ѹËõÊý¾Ý¿â)

ÒÔÏ´úÂëÔÚWIN2K,D6,MDAC2.6ϲâÊÔͨ¹ý,

±àÒëºÃµÄ³ÌÐòÔÚWIN98µÚ¶þ°æÎÞACCESS»·¾³ÏÂÔËÐгɹ¦.







//ÉùÃ÷Á¬½Ó×Ö·û´®

Const

SConnectionString      
= 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;'

+'Jet
OLEDB:Database Password=%s;';

//=============================================================================

// Procedure:
GetTempPathFileName

//
Author   : ysai

// Date     :
2003-01-27

// Arguments:
(None)

//
Result   : string

//=============================================================================

function GetTempPathFileName():string;

//È¡µÃÁÙʱÎļþÃû

var

SPath,SFile:array [0..254] of char;

begin

GetTempPath(254,SPath);

GetTempFileName(SPath,'~SM',0,SFile);

result:=SFile;

DeleteFile(result);

end;

//=============================================================================

// Procedure:
CreateAccessFile

//
Author   : ysai

// Date     :
2003-01-27

// Arguments:
FileName:String;PassWord:string=''

// Result   : boolean

//=============================================================================

function CreateAccessFile(FileName:String;PassWord:string=''):boolean;

//½¨Á¢AccessÎļþ£¬Èç¹ûÎļþ´æÔÚÔòʧ°Ü

var

STempFileName:string;

vCatalog:OleVariant;

begin

STempFileName:=GetTempPathFileName;

try

vCatalog:=CreateOleObject('ADOX.Catalog');

vCatalog.Create(format(SConnectionString,[STempFileName,PassWord]));

result:=CopyFile(PChar(STempFileName),PChar(FileName),True);

DeleteFile(STempFileName);

except<


Ïà¹ØÎĵµ£º

ASP excelµ¼³ö/µ¼ÈëAccessÊý¾Ý¿â(´úÂë+ʵÀýÏÂÔØ)

Excelµ¼³öº¯Êý
<%
Sub   ExportToExcel    
Response.ContentType   =   "application/vnd.ms-Excel"  
Response.AddHeader   "Content-Disposition",   "attachment;Filename=Results.xls"  
Response.Write  ......

ADOÊý¾Ý¿â²Ù×÷(ACCESS)

Ò»¡¢ADO¼ò½é
ADO(Active Data Object£¬»î¶¯Êý¾Ý¶ÔÏó)ʵ¼ÊÉÏÊÇÒ»ÖÖ»ùÓÚCOM(×é¼þ¶ÔÏóÄ£ÐÍ)ÖеÄ×Ô¶¯»¯½Ó¿Ú(IDispatch)¼¼Êõ£¬²¢ÒÔOLE DB(¶ÔÏóÁ¬½ÓºÍÏâÈëµÄÊý¾Ý¿â)Ϊ»ù´¡£¬¾­¹ýOLE DB¾«Ðİü×°ºóµÄÊý¾Ý¿â·ÃÎʼ¼Êõ£¬ÀûÓÃËü¿ÉÒÔ¿ìËٵĴ´½¨Êý¾Ý¿âÓ¦ÓóÌÐò¡£
ADOÌṩÁËÒ»×é·Ç³£¼òµ¥£¬½«Ò»°ãͨÓõÄÊý¾Ý·ÃÎÊϸ½Ú½øÐзâ×°µÄ¶ÔÏó¡£ÓÉÓ ......

Override Delphi Form's Restore Operation

{ Private declarations }
procedure WMSysCommand (var Msg: TWMSysCommand) ; message WM_SYSCOMMAND;
procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
if Msg.CmdType = SC_RESTORE then
begin
ShowMessage('SC_RESTORE');
if self.WindowState = wsMaximized then
begin
......

ÈçºÎÈÃDelphiµ÷ÓÃÍⲿ³ÌÐò²¢µÈ´ýÆäÔËÐÐÐÅÏ¢£¨Èç½áÊø£©

º¯ÊýÒ»£º
view plaincopy to clipboardprint?
uses 
    Windows,  
    SysUtils,  
    Classes,  
    ShellAPI;  
function RunAndWait(FileName: string; Visibility: Integer): THandle;&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ