no idea, I have never worked with mssql. Inside the main function declaration of coppermine there's the connection function (there is a slight degree of db abstarction in coppermine). You might want to take a look at include/functions.inc.php, find/**************************************************************************
Database functions
**************************************************************************/
// Connect to the database
function cpg_db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
if (!$result)
return false;
if (!mysql_select_db($CONFIG['dbname']))
return false;
return $result;
}
// Perform a database query
function db_query($query, $link_id = 0)
{
global $CONFIG, $query_stats, $queries;
$query_start = cpgGetMicroTime();
if (($link_id)) {
$result = mysql_query($query, $link_id);
} else {
$result = mysql_query($query);
}
$query_end = cpgGetMicroTime();
if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
$query_stats[] = $query_end - $query_start;
$queries[] = $query;
}
if (!$result) db_error("While executing query \"$query\" on $link_id");
return $result;
}
// Error message if a query failed
function db_error($the_error)
{
global $CONFIG;
if (!$CONFIG['debug_mode']) {
cpg_die(CRITICAL_ERROR, 'There was an error while processing a database query', __FILE__, __LINE__);
} else {
$the_error .= "\n\nmySQL error: ".mysql_error()."\n";
$out = "<br />There was an error while processing a database query.<br /><br/>
<form name='mysql'><textarea rows=\"8\" cols=\"60\">".htmlspecialchars($the_error)."</textarea></form>";
cpg_die(CRITICAL_ERROR, $out, __FILE__, __LINE__);
}
}
// Fetch all rows in an array
function db_fetch_rowset($result)
{
$rowset = array();
while ($row = mysql_fetch_array($result)) $rowset[] = $row;
return $rowset;
}Maybe it already works if you change those lines to work with mssql, but if it doesn't I'm afraid you will have to look into nearly every file, as they do the actual queries.
GauGau