diff --git a/phpgwapi/inc/class.db_mssql.inc.php b/phpgwapi/inc/class.db_mssql.inc.php
index c2fdd59818..8b98bf4581 100644
--- a/phpgwapi/inc/class.db_mssql.inc.php
+++ b/phpgwapi/inc/class.db_mssql.inc.php
@@ -371,5 +371,32 @@
{
return False;
}
+ function CreateDatabase($adminname='', $adminpasswd='')
+ {
+ $currentUser = $this->User;
+ $currentPassword = $this->Password;
+ $currentDatabase = $this->Database;
+
+ if($adminname != '')
+ {
+ $this->User = $adminname;
+ $this->Password = $adminpasswd;
+ $this->Database = 'master';
+ }
+ $this->disconnect();
+ $outval = $this->query("CREATE DATABASE $currentDatabase");
+ $this->disconnect();
+
+ if(!$outval)
+ {
+ echo 'Database creation failure
';
+ echo 'please setup the MSSQL database manually
';
+ }
+
+ $this->User = $currentUser;
+ $this->Password = $currentPassword;
+ $this->Database = $currentDatabase;
+ $this->connect();
+ }
}
?>