Hey,
I too got the same kind of error, although my browser would just sit there and keep trying to load rather than get an outright CGI error. I've managed to more or less jury rig a solution that will pull table names out of the Access Database, and you can add and delete table names from the database and the script should still run ok. Once again, the key here is that you can access odbc_fetch_row as many times as you'd like, you just can't access odbc_result more than twice per database connection. The code:
//Initialize Variables
$counter = 1;
$last_result = "";
while (True) {
//Make sure you change the "C:\Database\web_database" for your own //'TABLE_CAT'
$array = odbc_tables($connection, "C:\Database\web_database", "", "%", "'TABLE'");
//Increment the row pointer through the rows
for($i=0; $i<$counter; $i++){
odbc_fetch_row($array);
}
$result = odbc_result($array, "TABLE_NAME");
//The trick for breaking this loop, when odbc_fetch_row gets to the last record //and is called again, it just fetches the last record again. So if the current table //and the previously accessed table are the same, break the loop, you've got //them all.
if ($last_result == $result) {
break;
} else {
$last_result = $result;
}
echo $result . "<BR>";
$array = NULL;
odbc_close($connection);
include('login.inc'); //The odbc_connect function
$counter = $counter + 1;
}