|  | Posted by dkirkdrei on 05/09/07 15:33 
I am having a problem getting results back from a SELECT statementusing the script below. The field names contain decimals and I am not
 sure wether or not this is causing the problem or not?? I am
 connecting to a SQL server db using ODBC, first time connecting to SQL
 server but have been using ODBC to connect to Access db's for years. I
 have entered the field names just as they are in the table and I have
 tried replacing the spaces and decimals with underscores but still
 recieve the same error. Anyway, my simple script and the error that I
 am recieveing is below. Any help would be greatly appreciated..
 
 $connect = odbc_connect('cabngsql', '', '');
 if (!$connect)
 {
 echo "couldn't connect";
 exit;
 }
 $query1 = "SELECT fol no FROM Protocol.folder";
 $result1 = odbc_exec($connect, $query1);
 while (odbc_fetch_row($result1)){
 $folder = odbc_result($result1, 1);
 echo "$folder";
 }
 ?>
 
 ERROR: SQL error: [Microsoft][ODBC SQL Server Driver][SQL
 Server]Invalid object name 'Protocol.folder'., SQL state S0002 in
 SQLExecDirect
  Navigation: [Reply to this message] |