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.

Getting error while working with excel sheet

NiranjanNiranjan Members
edited November -1 in Sahi - Open Source
Hi,

I am very new to Sahi tool and exploring the tool and tried the below script to fetch the data from Excel sheet . I am using office 2010 with Win XP SP2 64 bit OS and installed access database engine for 64 bit windows. The data is not fetching from excel sheet instead I am getting error as "Data source name not found and no default driver specified " please help me out soon to resolve it.I tried all the below combination but no luck

1. MS Office 2010 64 bit
Installed access database engine for 64 bit windows
OS: Win XP SP2 64 bit
JDK: 64 bit

2.MS Office 2010 64 bit
Installed access database engine for 64 bit windows
OS: Win XP SP2 64 bit
JDK: removed 64 bit and installed 32 bit, Sahi does not display Browser in Sahi Dashboard.

3.MS Office 2010 32 bit
Installed access database engine for 32 bit windows
OS: Win XP SP2 64 bit
JDK: 32 bit: same error

4.MS Office 2010 32 bit
Installed access database engine for 64 bit windows
OS: Win XP SP2 64 bit
JDK: 64 bit: same error


Code used for fetching the data from excel sheet:

1. var $db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)}; DBQ=E:\\Testdata\\sample.xls ;readOnly=false", "", "");
var $rs = $db.select("select * from [Sheet1$]");
_log($rs);

2. var $db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=E:\\Testdata\\sample.xls ;readOnly=false", "", "");
var $rs = $db.select("select * from [Sheet1$]");
_log($rs);


My system configurations

windows XP Professional x64 Edition Version 2003 SP2

32 bit microsoft office 2003


Please let me know where I went wrong and solution for that...


Thanks in Advance,

Niranjan

Comments

  • Hey Niranjan,
    I too was facing the same issue...so i checked that at all (java,MS Office,DB Eng Driver) are of the same either 32 or 64 bit. OS is independent 64 can run a 32 but i am not sure 32 bit runs 64 bit.

    and coming to your code...try the following

    var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=C:\\location of folder\\Sahi_Data.xlsx;readOnly=false", "", "");
    if(db!=null)
    {
    $rs = db.select("select * from [Sheet1$]");

    }
  • I also agree with you ..... very useful information for us ...... keep it up thanks for this..........:)




    techsupportgeeks dot net
Sign In or Register to comment.