March 26, 2007
When you purchase Alchemy, you can purchase several different license types. Administrator gives all knowing access to everything. Index can still add content. Search just searches. Administrator costs the most, and Search the least. So a company will typically get many Search licenses, a few Index licenses, and minimal Administrators. But when building applications, some people aren’t aware that you can change the license type of your application. You should always pick the license type based on the type of activities your application will perform.
So to run an application with the features of Administrator, just load your app as you normally would. If you want to use an Index Station license you need to have the following line before you load any databases:
auApp.PutOptionsString("License", "Client", "IdxStation");
So typically this would show up right before:
But the important part of that command is when it loads the databases in the options file. You could replace it with this line to achieve the same result:
where blah.ald is the name of a database.
But I mentioned that there was a Search license you could consume instead. Achieving this it turns out is not easy…well, its easy to achieve, but learning how isn’t. I asked around internally and many people had no idea. It wasn’t until I got to the class this week and someone suggested this that I learned how to get this to work. What you need to do is to release the PutOptionsString line with this:
auApp.CanWrite = false;
On one hand this kind of makes sense. But it is so completely different from the PutOptionsString line that its not that intuitive. By calling that line before either adding a database or loading the options file, you consume only a Search license and not the more expensive Administrator license.