From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c2056b99faf05bbf X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!Spring.edu.tw!news.nctu.edu.tw!feeder.seed.net.tw!netnews!not-for-mail From: "bubble" Newsgroups: comp.lang.ada Subject: Re: ada and database Date: Mon, 29 Nov 2004 13:55:59 +0800 Organization: HiNetNews Message-ID: References: NNTP-Posting-Host: 211.21.128.195 X-Trace: netnews.hinet.net 1101708385 18213 211.21.128.195 (29 Nov 2004 06:06:25 GMT) X-Complaints-To: usenet@HiNetnews.hinet.net NNTP-Posting-Date: Mon, 29 Nov 2004 06:06:25 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:6630 Date: 2004-11-29T13:55:59+08:00 List-Id: copy it from http://en.wikibooks.org/wiki/Programming:Ada:Libraries:Database:GWindowswith Ada.Text_Io; use Ada.Text_Io; with Gnatcom.Initialize; with Gwindows.Databases; use Gwindows.Databases; with Gnatcom.Types; with Gnatcom.Variant; 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 bussiness solution while not Eof (Recordset) loop customer:=Gwindows.Databases.Field_Value(Recordset,"customerId"); process(customer);--your customer procedure Move_Next (Recordset); end loop; ---release database resource Gwindows.Databases.Close(Recordset); end test;