How to automate ODBC DSN creation on Mac OS

Filed under:Uncategorized — posted by jbs on November 12, 2007 @ 9:27 pm

Ok, I searched and searched and searched for this. Found a lot of stuff about Windows but NOTHING about how to automate ODBC DSN creation on a Mac. On Tiger, this is very, very easy.

Basically, you have to add the appropriate config lines to the file found in /Library/ODBC/odbc.ini

For example, let’s say you have a sqlite database that you want to connect to. You have installed the Actual Technology ODBC drivers but you want to deploy this application to a bunch of machines. You don’t have apple remote desktop, and you just want to run a script to get the job done.

The file is a standard ini file. You have to modify one category and add one in order to install the DSN. You must add the name of the new category (which is also the name of the DSN) to the ODBC Data Sources section. In this example, you would add a line like this:

newtest = Actual Open Source Databases

Now, you add a new section to the ini file that looks something like this

[newtest]
Driver = /Library/ODBC/Actual Open Source Databases.bundle/Contents/MacOS/atopnsrc.so
Type = SQLite
DBQ = /Users/jsmith/Documents/sqlite/test.db

Now, if you fire up the ODBC administrator, you will see your new DSN. Now for the Great Part: If you add this stuff to the /Library/ODBC/odbc.ini you create a system DSN. If, however, you add it to the odbc.ini found in ~/Library/ODBC (your home directory) you create a USER dsn.

Pretty cool, huh?

Alan Kay was right

Filed under:Uncategorized — posted by jbs on November 8, 2007 @ 4:47 pm

Alan Kay Was Right

Mac OS package management

Filed under:Uncategorized — posted by jbs on November 7, 2007 @ 10:22 pm

I just had a very strange situation. I’ve got this Tiger CD here that came with my Macbook Pro. But it seems to be corrupt somehow, because I coudln’t install a bunch of softare off of it. when I used my older Tiger CD’s it worked like a charm. But I got stuck down a rabbit hole for a while: where the crap is all the MacOS package manager documentation?

Nowhere, it seems.

I don’t like that at all.



image: detail of installation by Bronwyn Lace