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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: (GNADE) Access attribute not allowed in generic body Date: Thu, 15 Aug 2013 09:53:37 +0200 Organization: cbb software GmbH Message-ID: References: <86395c3d-e0e2-41f1-8286-08a64125fd2e@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: RXJ+FkxPc8/mFTAaIGiJWQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 4065 Xref: number.nntp.dca.giganews.com comp.lang.ada:183028 Date: 2013-08-15T09:53:37+02:00 List-Id: 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