Question

I try to connect to an advantage database server via .net data provider but i cannot browse through the tables, views, stored procedures (VS2010).

Although i cannot see the tables, i can query via a New query and writing a select manually

Seems simple, but yet no solution

Connection String: Data Source=TestAuth;User ID=adssys Provider: .NET Framework Data Provider for Advantage Database Server State: Open Type: Advantage Database Server Version: 11.0.0.1

Tried on 2 differend database servers but i cannot retrieve the tables

Similar issue via jdbc connection on Eclipse

Any ideas?

thank you in advance!

Aris

Was it helpful?

Solution 2

Thank you for you feedback Chris,

The issue found, wrong connection settings.

Quering the SELECT * FROM system.tables throws an error 5125 "Advantage does not have a data dictionary associated with the specified handle. AdsCommand query execution failed". So this explains whats was wrong, i used the alias and not the data dictionary

The tables on the Server Explorer are populated correctly

Connection String: User ID=adssys;Initial Catalog="C:\Program Files\Advantage 11.0\Help\ADS_DATA\IW.add"; User ID=adssys Provider: .NET Framework Data Provider for Advantage Database Server State: Open Type: Advantage Database Server Version: 11.0.0.1

OTHER TIPS

There are several ways to get a list of tables using Visual Studio 2010. The easiest is to use the Server Explorer and create a data connection to your Advantage Data Dictionary. Once the connection is open you can view the list of tables, views and stored procedures in the Server Explorer.

If you want to get a list of tables in code you can use either the GetTableNames() or GetDDObjects() methods of your AdsConnection Object. GetTableNames returns an array of table and view names. GetDDObjects returns an array of the specified object type.

A more generic approach is to use system.tables. You can open this table using an SQL statement and it will return information about all the tables in the database. See the example below.

SELECT * FROM system.tables

The GetDDObjects and system.tables are only available when connected to a Data Dictionary. GetTables will return a list tables on either a dictionary or free table connection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top