If you create a company folder as the name of this database and appropriate entries in config.php
Code:
$CompanyList[0] = array('database'=>'yourDBname' ,'company'=>'Your Company Name' );
When you attempt to login the automatic upgrade will work - it will ask you to select the version that you are upgrading from - you can select 3.11 or 4.01-4.02 and it will automatically apply all the SQL scripts since that date
When you login it looks for the version number recorded in includes/ConnectDB.inc and compares against the VersionNumber in the config table of the DB. However, in versions before 4.0 the VersionNumber variable in includes/ConnectDB.inc did not exist so in the old code and old DB the comparison cannot be done - so the upgrade script gives you a choice to manually select the version you are upgrading from.
The manual application of the SQL scripts is a worthy fall back :-)