跳轉到內容

Ada 程式設計/庫/資料庫/GWindows

來自華夏公益教科書,開放的書籍,開放的世界

Ada. Time-tested, safe and secure.
Ada.經久耐用、安全可靠。

庫函式

[編輯 | 編輯原始碼]

David Botton 建立了 GNATCOM 專案來幫助 Ada 與 Windows COM 物件進行互操作。GWindows 專案基於 GNATCOM。它用於建立 Windows 圖形使用者介面。

資料庫包是 GWindows 專案的子集。它非常簡單易用。

[編輯 | 編輯原始碼]
作者
David Botton
主頁
http://www.gnavi.org/index.php?Command=Class&ClassID=GWindowsWin32&Title=GWindows
專案資訊
GWindows
庫文件
http://www.gnavi.org/gwindows/ref/gwindows-databases.html
CVS 檔案
- 缺失 -
下載
http://www.gnavi.org

示例程式碼

[編輯 | 編輯原始碼]
with Gnatcom.Initialize;
with Gnatcom.Types;
with Gnatcom.Variant;
with Gwindows.Databases;  use Gwindows.Databases;
with Ada.Text_IO;         use Ada.Text_IO;
with Ada.Strings;
with Ada.Strings.Fixed;
with Ada.Exceptions;
with System;

procedure Test is
     Connection : Database_Type;
     Recordset  : Recordset_Type;  
     customer   : Gnatcom.Types.Variant; 
begin
     Gnatcom.Initialize.Initialize_Com;

     -- make connection
     Open (Connection,
        "DSN=Northwind","your ID","your password");

     -- make Recordset(ResultSet)
     Open (Recordset,
        Connection,
        "SELECT * from Orders",
        Dynamic,
        Optimistic);

     -- start to process your business solution
     while not Eof (Recordset) loop
        customer := Field_Value(Recordset,"customerId");
        Process (customer);       -- your customer procedure
        Move_Next (Recordset);
     end loop;

     -- release database resource
     Gwindows.Databases.Close(Recordset);
end Test;

華夏公益教科書

[編輯 | 編輯原始碼]

Ada 參考手冊

[編輯 | 編輯原始碼]

—不適用—

華夏公益教科書