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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.64.202 with SMTP id f10mr14738890qai.2.1376554633288; Thu, 15 Aug 2013 01:17:13 -0700 (PDT) X-Received: by 10.50.49.11 with SMTP id q11mr73835ign.12.1376554633247; Thu, 15 Aug 2013 01:17:13 -0700 (PDT) Path: border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!backlog2.nntp.ams.giganews.com!backlog2.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f7no2428656qan.0!news-out.google.com!he10ni1979qab.0!nntp.google.com!fx3no2548658qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 15 Aug 2013 01:17:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=159.245.48.2; posting-account=UaVslQkAAACVs7AM1tLAQ7VDC3JzDHQw NNTP-Posting-Host: 159.245.48.2 References: <86395c3d-e0e2-41f1-8286-08a64125fd2e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: (GNADE) Access attribute not allowed in generic body From: Dwiki Injection-Date: Thu, 15 Aug 2013 08:17:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 5128 X-Original-Bytes: 5338 Xref: number.nntp.dca.giganews.com comp.lang.ada:183029 Date: 2013-08-15T01:17:12-07:00 List-Id: Pada Kamis, 15 Agustus 2013 14:53:37 UTC+7, Dmitry A. Kazakov menulis: > On Thu, 15 Aug 2013 00:27:58 -0700 (PDT), Dwiki wrote: > > > > > im trying to compile app using gnade (1.5.3a) in windows, but it show error message > > [...] > > > any clue? > > > > Yes, I remember these errors caused by Ada 2005 vs. 95 incompatibilities. > > > > I stopped using GNADE long ago, but I still have the fixes I made in GNADE > > 2.0. I moved Get and Set to private part of the package and used > > 'Unrestricted_Access in Register. E.g.: > > ----------------------------- > > with GNU.DB.SQLCLI.Generic_Attr.String_Attribute; > > pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.String_Attribute); > > > > generic > > package GNU.DB.SQLCLI.Dispatch.A_String is > > > > package Derived is new Attr.String_Attribute; > > subtype Info is Derived.Attribute_Value_Pair_String; > > > > procedure Register (Index : in Attr.T); > > pragma Inline_Always (Register); > > > > private > > function Get (Handle : Ctx; > > Attribute : Attr.T; > > MaxLength : SQLSMALLINT := 0; > > Data : Attr.Aux; > > ErrorCode : access SQLRETURN) > > return Attr.Attribute_Value_Pair'Class; > > procedure Set (Handle : in Ctx; > > AV_Pair : in Attr.Attribute_Value_Pair'Class; > > Data : in Attr.Aux; > > ErrorCode : out SQLRETURN); > > > > end GNU.DB.SQLCLI.Dispatch.A_String; > > -------------------------------- > > package body GNU.DB.SQLCLI.Dispatch.A_String is > > > > function Get (Handle : Ctx; > > Attribute : Attr.T; > > MaxLength : SQLSMALLINT := 0; > > Data : Attr.Aux; > > ErrorCode : access SQLRETURN) > > return Attr.Attribute_Value_Pair'Class is > > begin > > return Info (Derived.GetAttr (Handle, > > Attribute, > > Data, > > MaxLength, > > ErrorCode)); > > end Get; > > > > procedure Set (Handle : in Ctx; > > AV_Pair : in Attr.Attribute_Value_Pair'Class; > > Data : in Attr.Aux; > > ErrorCode : out SQLRETURN) is > > begin > > if not (AV_Pair in Info'Class) then > > Raise_SQL_Error > > (ProcedureName => "SetAttr", > > ErrorMessage => "Attribute value is not a String", > > RC => SQL_ADA95_TYPE_ERROR); > > end if; > > Derived.SetAttr (Handle, Info (AV_Pair), Data, ErrorCode); > > end Set; > > > > procedure Register (Index : in Attr.T) is > > begin > > Get_Dispatch_Array (Index) := Get'Unrestricted_Access; > > Set_Dispatch_Array (Index) := Set'Unrestricted_Access; > > end Register; > > > > end GNU.DB.SQLCLI.Dispatch.A_String; > > ----------------------------------- > > I cannot tell if that helps, because, as I said I don't use it anymore. > > > > P.S. > > > > 1. GNADE seems to be not maintained. > > > > 2. GNADE ODBC bindings will certainly not work on any natively 64-bit > > platform because MS changed ODBC API. If you want ODBC bindings you can try > > these: > > > > http://www.dmitry-kazakov.de/ada/components.htm#ODBC_Bindings > > > > -- > > Regards, > > Dmitry A. Kazakov > > http://www.dmitry-kazakov.de GOD BLESS YOU Dmitry, big thanks it works now, im using gnade because there is a minor change in old application that using gnade, one more time u save me and my job :D