動態建立ACCESS資料庫

2021-04-30 20:29:59 字數 607 閱讀 8951

1:通過ole方式建立

uses comobj;

procedure tformoffice.bitbtn1click(sender: tobject);

varcreateaccess:olevariant;

begin

createaccess:=createoleobject(´adox.catalog´);

createaccess.create(´provider=microsoft.jet.oledb.4.0;data source=c:/aceco.mdb´);

end;

說明:1、在c:/下建立aceco.mdb;

2、是access2000格式,用access97打不開;

3、系統需安裝mdac,這是好訊息,客戶不需安裝access也可以

2:採用資源檔案方式

建立乙個文字檔案寫入 mdb rcdata aceco.mdb  ,儲存為 aceco.rc

//aceco.mdb 為原始的mdb檔案

在執行裡進入改檔案目錄,執行 brcc32  aceco.rc 則建立了 aceco.res資源檔案,工程重新建立之後

檔案裡加入

//加入資源檔案

vc ado動態建立access資料庫

如何使用ado來動態建立access資料庫。為了使用ado,必須引入微軟的兩個動態連線庫msadox.dll和msado15.dll pragma warning disable 4146 import c program files mon files system ado msadox.dll ...

vc ado動態建立access資料庫

ado技術目前已經成為連線資料庫的主流技術,下面我來介紹如何使用ado來動態建立access資料庫。為了使用ado,必須引入微軟的兩個動態連線庫msadox.dll和msado15.dll pragma warning disable 4146 import c program files mon ...

如何動態建立ACCESS資料庫

配套例子程式 例1 動態建立access資料庫 程式設計環境 對話方塊程式設計 資料庫名 test 1 在stdafx.h中加入 import c program files common files system ado msadox.dll import c program files comm...