18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Excel Could not able to find object

gopikannangopikannan Members
edited November -1 in Sahi - Open Source
HI

My db connection is
$ConfigPath = $ScriptPath + "Testdata\\\P1S-Configurations.xls";

dbconn = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=$ConfigPath;readOnly=false","","");

var $rs = dbconn.select("select * from [Configurations$]");

when i try to exeute above code i am gettintg an error message as

ERROR
exception: java.sql.SQLException: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'Configurations$'. Make sure the object exists and that you spell its name and the path name correctly.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)


Kindly help me on this..

Comments

  • Hi Sumitra,

    I tried all below urls , but still i am getting same issue

    Below line isworking fine

    dbconn = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\SAHI Automation\\Testdata\\P1S-Configurations.xls;readOnly=false","","");

    but while assigning variable its not working ... why?

    $ConfigPath = $ScriptPath + "Testdata\\\P1S-Configurations.xls";

    dbconn = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=$ConfigPath;readOnly=false","","");

    What is the solution for assigning the variable in DBQ

    Thanks
    Gopikannan
  • Hi Gopikannan,

    Assuming $ScriptPath = "C:/SAHI Automation/";
    var $ConfigPath = $ScriptPath + "Testdata/P1S-Configurations.xls";
    
    dbconn = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ="+$ConfigPath+";readOnly=false","","");
    
    

    Check if this helps you to solve your issue.

    Regards
    Sumitra
  • Great reply... imeediately it worked.. Thank u very much.
This discussion has been closed.