Wednesday, July 15, 2009

Tip #48 – Get Database Info from AdsConnection Object

Along with the server properties the AdsConnection object also has several properties that are populated when a connection to an Advantage Data Dictionary is made. One of the most useful properties is the IsDictionaryConn property. This returns true whenever a connection to a data dictionary is made.

With a dictionary connection you can view the database name, major and minor versions. The database name contains either the full path to the ADD file or the contents of the initial catalog connection string property. The major and minor versions are stored in the data dictionary and can be configured in ARC or by using SQL Commands.

Data Dictionary Properties

The database name is returned as a string and the version properties are retuned as integer values. See the example below.

Database Info

No comments: