How to fix this error object of class variant could not be converted to string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santhanalakshmi
    New Member
    • May 2009
    • 147

    How to fix this error object of class variant could not be converted to string?

    Hi,
    I don't have any idea on this error:
    Object of class variant could not be converted to string.
    I am facing the error in this block.Please have a look on this:
    Code:
    IF($g!="P")
           {
              mssql_close($dbhandle);
    	 //*** Close & Quit ***//  
    	 $excel_app->Application->Quit();  
    	 $excel_app = null;  
             $Workbook = null;  
             $Worksheet = null; 
             
             if (file_exists("$uploadedfilepath"))
             {
                 #delete
                 unlink($uploadedfilepath) or die ("Could not delete file"); 
             }
              exit("error in uploading"."  ".$idno)	                   
    
           }
    I don't have idea in this error. Please help me out.Thanks in advance
    Last edited by Niheel; May 17 '11, 01:46 PM.
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Looks like the error is in the $excel_app class

    Comment

    • santhanalakshmi
      New Member
      • May 2009
      • 147

      #3
      Hi,
      No. I think so. Not by Excel Application

      $g is a variable. (ie $g="P" ). If this condition is satisfied...i am trying to close db connection and at the same time "deleting my files".

      I am facing this error, mainly from EXIT FUNCTION. I don't why?
      1. Closing db connection
      2. deleting my files from a directory
      3. using EXIT FUNCTION - to stop script. (problem here only)

      and i tried this also, if i am using only EXIT FUNCTION (Without using Closing db connection and deleting my files from a directory)means , i am not facing this error..

      and i too tried this also, if i replace EXIT FUNCTION as my first step and then remaining two follows this. Then also, i am facing this error.

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        This doesn't make a lot of sense without knowledge of the classes you are using.
        Your first post is using Excel but in your second you talk about databases.
        None of the 'errors' you have reported are php errors.
        In fact they don't sound like errors at all.
        What is EXIT FUNCTION?

        Comment

        Working...