Thu 07 Nov 2002 03:45:58 PM UTC, original submission:
I found the following two problems:
Errors appeared when setup tried to create the tables in the server. The tables would be created, but when setup tried to insert any values in the tables, validation would fail due to unexpected null values.
The reason is that the database routines assume default ANSI behavior for table creation, and specifically that fields are nullable unless specified otherwise. This is not true for MS SQL 7.0, as the default for new fields is NOT nullable.
This can be changed at the database level by entering the database properties dialog, Options tab, and checking the ANSI NULL default property. I would recommend that this is explained in the installation docs, or that the installation routines are changed to eliminate this assumption.
The second error is that, even when the tables were created, the setup routines didnt detect them. This meant that when the tables finished installing, instead of moving onto the next step, you were redirected to the previous one. Trying to create the tables again gave errors, of course.
The reason for this is in the table_names() function from the phpgwapi\inc\class.db_mssql.inc.php file:
function table_names()
{
$this->query("select name from sysobjects where type='u' and name != 'dtproperties'");
$i = 0;
while ($info = @mssql_fetch_row($this->Query_ID))
{
$return[$i]['table_name'] = $info[0];
$return[$i]['tablespace_name'] = $this->Database;
$return[$i]['database'] = $this->Database;
$i++;
}
return $return;
}
For MS SQL Server 7.0, table objects are not type u, they are type U, so it should read like this:
$this->query("select name from sysobjects where type='U' and name != 'dtproperties'");
I will report back if I find any other errors.
|