diff --git a/infolog/inc/class.vfs.inc.php b/infolog/inc/class.vfs.inc.php index 1725eeb586..24eccd2da5 100644 --- a/infolog/inc/class.vfs.inc.php +++ b/infolog/inc/class.vfs.inc.php @@ -127,8 +127,15 @@ $this->meta_types = array ('journal', 'journal-deleted'); /* We store the linked directories in an array now, so we don't have to make the SQL call again */ - - $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE link_directory != '' AND link_name != ''" . $this->extra_sql (VFS_SQL_SELECT)); + if ($GLOBALS['phpgw_info']['server']['db_type']=='mssql' + || $GLOBALS['phpgw_info']['server']['db_type']=='sybase') + { + $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE CONVERT(varchar,link_directory) != '' AND CONVERT(varchar,link_name) != ''" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__,__FILE__); + } + else + { + $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE link_directory != '' AND link_name != ''" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__,__FILE__); + } $this->linked_dirs = array (); while ($GLOBALS['phpgw']->db->next_record ()) diff --git a/phpgwapi/inc/class.vfs_sql.inc.php b/phpgwapi/inc/class.vfs_sql.inc.php index 2858bcec0e..cf0d8c9f95 100644 --- a/phpgwapi/inc/class.vfs_sql.inc.php +++ b/phpgwapi/inc/class.vfs_sql.inc.php @@ -142,8 +142,16 @@ $this->meta_types = array ('journal', 'journal-deleted'); /* We store the linked directories in an array now, so we don't have to make the SQL call again */ + if ($GLOBALS['phpgw_info']['server']['db_type']=='mssql' + || $GLOBALS['phpgw_info']['server']['db_type']=='sybase') + { + $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE CONVERT(varchar,link_directory) != '' AND CONVERT(varchar,link_name) != ''" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__,__FILE__); + } + else + { + $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE link_directory != '' AND link_name != ''" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__,__FILE__); + } - $query = $GLOBALS['phpgw']->db->query ("SELECT directory, name, link_directory, link_name FROM phpgw_vfs WHERE link_directory != '' AND link_name != ''" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT))); $this->linked_dirs = array (); while ($GLOBALS['phpgw']->db->next_record ())