All,

I trying to trap a permission denied error from SqlServer within Perl and I
seem to get a message no matter what on the browser. Below is a snippet of
the code. 

What happens is that if I set the table junk permissions to no select for a
user, Perl comes back with a message like the following:

[Microsoft][ODBC SQL Server Driver][SQL Server]SELECT permission denied on
object 'Junk', database 'ACLDB', owner 'dbo'. Win32::OLE(0.1601) error
0x80040e09 in METHOD/PROPERTYGET "execute" at c:\inetpub\wwwroot\testlog.pl
line 63 Can't call method "Fields" on an undefined value at
c:\inetpub\wwwroot\testlog.pl line 65. Content-Type: text/html <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
 and etc.




Code Snippet:

             print    start_html,hr, 
                                start_form;

                $Conn = Win32::OLE->new('ADODB.Connection');   
                $Conn->Open('ACLDB');  
                $SQL = "Select * from junk";
                $RS = $Conn->execute($SQL);
                if (!Win32::OLE->LastError()) {
                                                        $test =
$RS->Fields(0)->value;
                                                        $RS->Close();
                                                        }
                $Conn->Close();

                print "<h1>This test shows $test </h1>",
                        end_form;


Is there some way to trap this so it does not automatically display on the
browser (IE 6.x)?

Many thanks,

Tom

<<application/ms-tnef>>

Reply via email to