跳转到内容

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 参考手册

[编辑 | 编辑源代码]

—不适用—

华夏公益教科书