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.

Error 5116 when executing sql query

4 posts in FoxPro Last posting was on 2006-11-14 23:53:55.0Z
Adrian van der Merwe Posted on 2006-11-09 03:54:05.0Z
From: "Adrian van der Merwe" <adrianv@taly.net>
Newsgroups: advantage.foxpro
Subject: Error 5116 when executing sql query
Date: Thu, 9 Nov 2006 05:54:05 +0200
Lines: 25
Organization: Taly Computer Solutions
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
NNTP-Posting-Host: 219.133.227.201
Message-ID: <4552a577@solutions.advantagedatabase.com>
X-Trace: 8 Nov 2006 20:50:15 -0700, 219.133.227.201
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!219.133.227.201
Xref: solutions.advantagedatabase.com Advantage.FoxPro:206
Article PK: 1109560

Hi,

If I connect to my database (data dictionary on ADS 8.0 on NT platform) and
execute the following SQL query in the SQL utility I get a result set.

select "index",number,subnumber,name from debtors ORDER BY name


But if I use the ACE and the same query string I get a 5116 error (Index
expression not found) If I leave out the ORDER BY clause it works perfectly.

result = AdsExecuteSQLDirect ( handle,SqlStatement,@resulthandle)

The table is Debtors.ADT and has a simple index on name called name. The
field is CI with a width of 40.


--
Adrian van der Merwe
Software Development and Support
Taly Computer Solutions
TEL: +27-11-7068448
FAX: +27-11-7068378


"Alex Wong \(ADS\)" <alexw Posted on 2006-11-09 20:38:50.0Z
From: "Alex Wong \(ADS\)" <alexw@*n_o__s_p_a_m*sybase.com>
Newsgroups: advantage.foxpro
References: <4552a577@solutions.advantagedatabase.com>
Subject: Re: Error 5116 when executing sql query
Date: Thu, 9 Nov 2006 13:38:50 -0700
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 10.24.38.183
Message-ID: <455390e1@solutions.advantagedatabase.com>
X-Trace: 9 Nov 2006 13:34:41 -0700, 10.24.38.183
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.183
Xref: solutions.advantagedatabase.com Advantage.FoxPro:207
Article PK: 1109561

Hi Adrian,

If the statement worked in ARC's SQL utility then it is unlikely a problem
with the server. Can you verify that the ARC and your ACE application is
using the same version of the client dll (ace32.dll and axcws32.dll)? Are
you certain that the error is returned from AdsExecuteSQLDirect()?

Alex

"Adrian van der Merwe" <adrianv@taly.net> wrote in message
news:4552a577@solutions.advantagedatabase.com...
> Hi,
>
> If I connect to my database (data dictionary on ADS 8.0 on NT platform)
> and
> execute the following SQL query in the SQL utility I get a result set.
>
> select "index",number,subnumber,name from debtors ORDER BY name
>
>
> But if I use the ACE and the same query string I get a 5116 error (Index
> expression not found) If I leave out the ORDER BY clause it works
> perfectly.
>
> result = AdsExecuteSQLDirect ( handle,SqlStatement,@resulthandle)
>
> The table is Debtors.ADT and has a simple index on name called name. The
> field is CI with a width of 40.
>
>
> --
> Adrian van der Merwe
> Software Development and Support
> Taly Computer Solutions
> TEL: +27-11-7068448
> FAX: +27-11-7068378
>
>


Adrian van der Merwe Posted on 2006-11-14 03:47:18.0Z
From: "Adrian van der Merwe" <adrianv@taly.net>
Newsgroups: advantage.foxpro
References: <4552a577@solutions.advantagedatabase.com> <455390e1@solutions.advantagedatabase.com>
Subject: Re: Error 5116 when executing sql query
Date: Tue, 14 Nov 2006 05:47:18 +0200
Lines: 60
Organization: Taly Computer Solutions
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
NNTP-Posting-Host: 121.35.216.93
Message-ID: <45593ba3@solutions.advantagedatabase.com>
X-Trace: 13 Nov 2006 20:44:35 -0700, 121.35.216.93
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!121.35.216.93
Xref: solutions.advantagedatabase.com Advantage.FoxPro:208
Article PK: 1109563

Yes, I only have one version installed on this machine. Yes, I am sure that
the error comes from AdsExecuteSqlDirect()

I have found a workaround. If I change the order by clause as follows it
works 100%:
select "index",number,subnumber,name from debtors ORDER BY UPPER(name)

So I can carry on, but I'm still curious what the problem was?

Adrian

"Alex Wong (ADS)" <alexw@*n_o__s_p_a_m*sybase.com> wrote in message
news:455390e1@solutions.advantagedatabase.com...
> Hi Adrian,
>
> If the statement worked in ARC's SQL utility then it is unlikely a problem
> with the server. Can you verify that the ARC and your ACE application is
> using the same version of the client dll (ace32.dll and axcws32.dll)? Are
> you certain that the error is returned from AdsExecuteSQLDirect()?
>
> Alex
>
>
>
>
>
> "Adrian van der Merwe" <adrianv@taly.net> wrote in message
> news:4552a577@solutions.advantagedatabase.com...
> > Hi,
> >
> > If I connect to my database (data dictionary on ADS 8.0 on NT platform)
> > and
> > execute the following SQL query in the SQL utility I get a result set.
> >
> > select "index",number,subnumber,name from debtors ORDER BY name
> >
> >
> > But if I use the ACE and the same query string I get a 5116 error (Index
> > expression not found) If I leave out the ORDER BY clause it works
> > perfectly.
> >
> > result = AdsExecuteSQLDirect ( handle,SqlStatement,@resulthandle)
> >
> > The table is Debtors.ADT and has a simple index on name called name. The
> > field is CI with a width of 40.
> >
> >
> > --
> > Adrian van der Merwe
> > Software Development and Support
> > Taly Computer Solutions
> > TEL: +27-11-7068448
> > FAX: +27-11-7068378
> >
> >
>
>


"Alex Wong \(ADS\)" <alexw Posted on 2006-11-14 23:53:55.0Z
From: "Alex Wong \(ADS\)" <alexw@*n_o__s_p_a_m*sybase.com>
Newsgroups: advantage.foxpro
References: <4552a577@solutions.advantagedatabase.com> <455390e1@solutions.advantagedatabase.com> <45593ba3@solutions.advantagedatabase.com>
Subject: Re: Error 5116 when executing sql query
Date: Tue, 14 Nov 2006 16:53:55 -0700
Lines: 77
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 10.24.38.183
Message-ID: <455a561b@solutions.advantagedatabase.com>
X-Trace: 14 Nov 2006 16:49:47 -0700, 10.24.38.183
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.183
Xref: solutions.advantagedatabase.com Advantage.FoxPro:209
Article PK: 1109562

Are you sure that your ACE application is connected to the remote server and
not using local server? You can verify that using the ads_cfg.exe on the
server. What are the version numbers of the ACE32.DLL and ADSLOC32.DLL (if
there is one) on the client computer?

--
Alex

"Adrian van der Merwe" <adrianv@taly.net> wrote in message
news:45593ba3@solutions.advantagedatabase.com...
> Yes, I only have one version installed on this machine. Yes, I am sure
> that
> the error comes from AdsExecuteSqlDirect()
>
> I have found a workaround. If I change the order by clause as follows it
> works 100%:
> select "index",number,subnumber,name from debtors ORDER BY UPPER(name)
>
> So I can carry on, but I'm still curious what the problem was?
>
> Adrian
>
>
> "Alex Wong (ADS)" <alexw@*n_o__s_p_a_m*sybase.com> wrote in message
> news:455390e1@solutions.advantagedatabase.com...
>> Hi Adrian,
>>
>> If the statement worked in ARC's SQL utility then it is unlikely a
>> problem
>> with the server. Can you verify that the ARC and your ACE application is
>> using the same version of the client dll (ace32.dll and axcws32.dll)? Are
>> you certain that the error is returned from AdsExecuteSQLDirect()?
>>
>> Alex
>>
>>
>>
>>
>>
>> "Adrian van der Merwe" <adrianv@taly.net> wrote in message
>> news:4552a577@solutions.advantagedatabase.com...
>> > Hi,
>> >
>> > If I connect to my database (data dictionary on ADS 8.0 on NT platform)
>> > and
>> > execute the following SQL query in the SQL utility I get a result set.
>> >
>> > select "index",number,subnumber,name from debtors ORDER BY name
>> >
>> >
>> > But if I use the ACE and the same query string I get a 5116 error
>> > (Index
>> > expression not found) If I leave out the ORDER BY clause it works
>> > perfectly.
>> >
>> > result = AdsExecuteSQLDirect ( handle,SqlStatement,@resulthandle)
>> >
>> > The table is Debtors.ADT and has a simple index on name called name.
>> > The
>> > field is CI with a width of 40.
>> >
>> >
>> > --
>> > Adrian van der Merwe
>> > Software Development and Support
>> > Taly Computer Solutions
>> > TEL: +27-11-7068448
>> > FAX: +27-11-7068378
>> >
>> >
>>
>>
>
>