Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

AdsDictionary.GetDatabaseProperty Problems

3 posts in Delphi Last posting was on 2003-09-04 16:12:38.0Z
"Jeff Kreider" Posted on 2003-09-04 06:00:05.0Z
From: "Jeff Kreider" <jeff -at- pctournaments REMOVE ME.com>
Newsgroups: Advantage.Delphi
Subject: AdsDictionary.GetDatabaseProperty Problems
Date: Thu, 4 Sep 2003 01:00:05 -0500
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 66.188.90.85
Message-ID: <3f56d53d@solutions.advantagedatabase.com>
X-Trace: 4 Sep 2003 00:01:33 -0700, 66.188.90.85
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!66.188.90.85
Xref: solutions.advantagedatabase.com Advantage.Delphi:13866
Article PK: 1107300

I am using ADS 6.2. I am trying to get the dictionary's version. The code
I am using is:

function TdmInStats.CheckDBVersion: string;
var
majVersion, minVersion: array[ 0..ADS_DD_MAX_PROPERTY_LEN ] of char;
lenBuffer: UNSIGNED16;
begin
AdsDictionary.Connect;
try
lenBuffer := ADS_DD_MAX_PROPERTY_LEN;
AdsDictionary.GetDatabaseProperty(ADS_DD_COMMENT, @aComment,
lenBuffer );
AdsDictionary.GetDatabaseProperty(ADS_DD_VERSION_MAJOR, @majVersion,
lenBuffer);
<snip>
finally
AdsDictionary.Disconnect;
end;
end;

Getting the comment works ok. However, when I attempt to get the major
version I get a 5133 error saying that, "The supplied buffer is not the
expected size for the specified property. The property is a 16-bit value."
The help file doesn't make any kind of distinction of different property
sizes for the different properties. What should I be doing to get the major
version? I don't need or want the comment. I just wanted to see if I could
get something to work.

--
Jeff Kreider


Tobias Lehnert Posted on 2003-09-04 11:58:42.0Z
From: "Tobias Lehnert" <T.Lehnert@dtzaenker.de>
Newsgroups: Advantage.Delphi
References: <3f56d53d@solutions.advantagedatabase.com>
Subject: Re: AdsDictionary.GetDatabaseProperty Problems
Date: Thu, 4 Sep 2003 13:58:42 +0200
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 217.85.123.124
Message-ID: <3f572854@solutions.advantagedatabase.com>
X-Trace: 4 Sep 2003 05:56:04 -0700, 217.85.123.124
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!217.85.123.124
Xref: solutions.advantagedatabase.com Advantage.Delphi:13868
Article PK: 1107303

Hi Jeff,

> function TdmInStats.CheckDBVersion: string;
> var
> majVersion, minVersion: array[ 0..ADS_DD_MAX_PROPERTY_LEN ] of char;
> lenBuffer: UNSIGNED16;
> begin
> AdsDictionary.Connect;
> try
> lenBuffer := ADS_DD_MAX_PROPERTY_LEN;
> AdsDictionary.GetDatabaseProperty(ADS_DD_COMMENT, @aComment,
> lenBuffer );

I think you have to set the lenBuffer again, because after
GetDatabaseProperty lenBuffer shows the length of the comment.
The help file says: "On input, the usBufferLength should be equal to or
greater than 2."

lenBuffer := 2;

> AdsDictionary.GetDatabaseProperty(ADS_DD_VERSION_MAJOR, @majVersion,
> lenBuffer);
> <snip>
> finally
> AdsDictionary.Disconnect;
> end;
> end;
>


Tobias


"Jeff Kreider" Posted on 2003-09-04 16:12:38.0Z
From: "Jeff Kreider" <jeff(-at-)pctournaments.com>
Newsgroups: Advantage.Delphi
References: <3f56d53d@solutions.advantagedatabase.com> <3f572854@solutions.advantagedatabase.com>
Subject: Re: AdsDictionary.GetDatabaseProperty Problems
Date: Thu, 4 Sep 2003 11:12:38 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 168.236.254.1
Message-ID: <3f5764d4@solutions.advantagedatabase.com>
X-Trace: 4 Sep 2003 10:14:12 -0700, 168.236.254.1
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!168.236.254.1
Xref: solutions.advantagedatabase.com Advantage.Delphi:13876
Article PK: 1107312

Thanks Tobias,
I don't know how many times I read that and every time completely missed it.
It's working now.

Jeff

"Tobias Lehnert" <T.Lehnert@dtzaenker.de> wrote in message
news:3f572854@solutions.advantagedatabase.com...
> Hi Jeff,
>
> > function TdmInStats.CheckDBVersion: string;
> > var
> > majVersion, minVersion: array[ 0..ADS_DD_MAX_PROPERTY_LEN ] of char;
> > lenBuffer: UNSIGNED16;
> > begin
> > AdsDictionary.Connect;
> > try
> > lenBuffer := ADS_DD_MAX_PROPERTY_LEN;
> > AdsDictionary.GetDatabaseProperty(ADS_DD_COMMENT, @aComment,
> > lenBuffer );
>
> I think you have to set the lenBuffer again, because after
> GetDatabaseProperty lenBuffer shows the length of the comment.
> The help file says: "On input, the usBufferLength should be equal to or
> greater than 2."
>
> lenBuffer := 2;
>
> > AdsDictionary.GetDatabaseProperty(ADS_DD_VERSION_MAJOR, @majVersion,
> > lenBuffer);
> > <snip>
> > finally
> > AdsDictionary.Disconnect;
> > end;
> > end;
> >
>
>
> Tobias
>
>