Duh, stupid me. I'm using MSVC on Windows. DBI just has some database wrappers. Since it doesn't do anything unless one of its functions are implicitly called I can't see how the placing should matter. The only relevant class functions are:
I've managed to do essentially the same thing with another class too though, so I'm guessing it has something to do with c++ perhaps?
if( !mysql_init(&mysql) ) this->fail( FAILED_ON_INIT );
if( !mysql_real_connect( &mysql, "localhost", NULL, NULL, "one", 0, NULL, 0 ) )
this->fail( FAILED_ON_CONNECT );