Wednesday, September 3, 2008

FAQs – August 2008

Here is the latest installment of my monthly FAQs. August was a very busy month for me and I spent a lot of time working on sample code. Here are a few of the questions I answered last month.

Accessing Free Tables Through a Data Dictionary Connection

In an earlier post about security I discussed disabling free table connections. This ensures that all users authenticate to a data dictionary before they can open any tables. This does not mean that you cannot still access free tables through this connection. In fact you can access any tables in the Dictionaries Default Path. The tables in this path do not need to be associated with the dictionary.

You can also create views which access free tables using a relative path from the dictionary. I demonstrated this technique in a tech-tip where I used a view to allow access to the Advantage Error Log file. This allows your program to access the Advantage Error Log (ads_err.adt) without sharing or making a connection to the Error Log path on the server.

Using Advantage from a Web Site

Advantage has many clients which can be used to access the data from a web site. I primarily use the Advantage .NET Data Provider with ASP.NET for web development. However, we also support DBI, PHP and Java clients. This gives developers a wide variety of connection options when developing their web sites and web based applications.

During our Advantage Technical Training we provide sessions on using Advantage with ASP.NET, PHP and Java. These sessions are very informative and provide lots of information on how to integrate Advantage data into your web site.

Did You Know

You can get the name of the application that is connected to Advantage through the Advantage Management API? When applications connect to Advantage the application name is automatically specified for the ApplictionID property of the connection. This property has now been added to the ADS_MGMT_USER_INFO structure which you can retrieve using the AadsMgGetUserNames API call.

You can also get this information using the sp_mgGetConnectedUsers or sp_GetApplicationID system procedures. The ApplicationID can also be set using the sp_SetApplicationID if you want to specify a specific name or instance of your application for the given connection.

This field was also added to the management utility in version 9.0 of Advantage Data Architect.

Advantage Management Utility

Using Events

Events are a new feature added in version 9.0 of Advantage. Over the past couple of months I have written a couple of tech tips, you can find them here and here, and an example Visual Studio application. Events are a powerful way to notify your application when certain events occur on the database server. I am currently working on an Events sample for Delphi that I will get posted as soon as possible.

In the meantime, if you are using Events or have a good idea for how they can be used please leave me a comment.

No comments: