Error trying to connect to advantage database server using ADS dataprovider

Posted on 2008-10-17
Last Modified: 2013-11-23
I am trying to integrate alongside an existing application that uses ADS as its database.
When i connect my integration app using the code below it connects fine until i try and run the original application at the same time. It seems to only allow one connection, my application seems to hold the connection and block all others. Yet i can have multiple instances of the original application running conncurrently with no issue. Which leads me to believe that its the way in which i am trying to correct from my c# app. The error im getting when the original app is open and i then try to connect with my integration app is "The Advantage Data Dictionary cannot be opened.  axServerConnect" .

Also i have tried changing the connection string to point to the folder instead of the actual dictionary so instead of c:\Cash4W\data\CashForWindows.Add i was trying to connect to c:\Cash4W\data but then i got the error
Error on connection 1 Error 7200:  AQE Error:  State = HY000;   NativeError = 5159;  [iAnywhere Solutions][Advantage SQL][ASA] Error 5159:  Error encountered when trying to open a database table.  The table is a database table. It cannot be opened as a free table. Table name: call  AdsCommand query execution failed.

Anyone any suggestions ??
AdsConnection connection = new AdsConnection();

AdsCommand cmd = new AdsCommand();

AdsDataAdapter adapter = new AdsDataAdapter();

DataSet dset = new DataSet();

Connectionstring = "Data Source=c:\Cash4W\data\CashForWindows.Add;user ID="Adssys";ServerType=ADS_LOCAL_SERVER;TrimTrailingSpaces=True;        

connection.ConnectionString = Connectionstring;



string sql = " SELECT top 1 * from call";

cmd.CommandText = sql;

cmd.Connection = connection;

adapter.SelectCommand = cmd;


if (dset.Tables[0].Rows.Count > 0)


     success = true;



Open in new window

Question by:MCLR
  • 3
  • 3

Expert Comment

ID: 22741136
Two possible solutions - both addressing the problem that your code doesn't close the connection:
1.  The default .net data adapters will automatically open and close the connection for you - do not manually open the connection, and it will be open / closed automatically by the adapter.

2.  Call connection.Close() after you call adapter.Fill(dset)

Author Comment

ID: 22741199
sorry i forgot to put that line in i had  connection.Close(); in the finally part of a try statement

I tried removing the manual connection open though as in your suggestion 1 but the same issue was happening , any other ideas ?

Expert Comment

ID: 22741555
Does the AdsConnection expose a Dispose method that you should be calling after Close?
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.


Author Comment

ID: 22741628
It does have a dispose method but Its not opening the connection for me in the first place when i have the original app open. so while i can open multiple instances of the original app i cant open my new app unless i close the original app and vice versa.

So i guess i need to be connecting to the database a different way ??
I tried changing around the additional connection string settings SecurityMode=ADS_IGNORERIGHTS;LockMode=ADS_COMPATIBLE_LOCKING but this made no difference either

Expert Comment

ID: 22741784
I'm sorry, I was misunderstanding - "my application seems to hold the connection and block all others"

Looks like you may need to follow up with iAnywhere Solutions - I'm out of my realm now.

Accepted Solution

MCLR earned 0 total points
ID: 22776579

It turns out that i needed to change the servertype to remote instead of local and then i had the incorrect version of the advantage data provider so i had to download version 8.1 instead of 9.

Then the issue was resolved

Connectionstring = "Data Source=c:\test.Add;user ID="Adssys";ServerType=remote;TrimTrailingSpaces=True;        


Open in new window


Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now