From: Dwiki <dwiki.jtk07@gmail.com>
Subject: Re: (GNADE) Access attribute not allowed in generic body
Date: Thu, 15 Aug 2013 01:17:12 -0700 (PDT)
Date: 2013-08-15T01:17:12-07:00 [thread overview]
Message-ID: <c6d83549-8ba0-4ff7-a0ce-dc250551d2a6@googlegroups.com> (raw)
In-Reply-To: <c2kkhpusa6e7.1py6twokcaei3$.dlg@40tude.net>
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
next prev parent reply other threads:[~2013-08-15 8:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 7:27 (GNADE) Access attribute not allowed in generic body Dwiki
2013-08-15 7:37 ` Dwiki
2013-08-15 7:53 ` Dmitry A. Kazakov
2013-08-15 8:17 ` Dwiki [this message]
2013-08-16 16:46 ` Stephen Leake
2013-08-18 13:40 ` Dwiki
2013-08-15 8:37 ` egilhh
2013-08-16 16:44 ` Stephen Leake
2013-08-15 13:42 ` Shark8
2013-08-15 15:10 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox