Forum Discussion

Nbabutc's avatar
Nbabutc
Occasional Contributor
4 years ago
Solved

Reading from excel is not accurate

Hi,

I am traying to read from excel but it always showing wrong data, 

In this sheet, the selected rows 1,  

Nbabutc_0-1645075415845.png

if its fetch 1 record then its should fetch the details of that one. but it is fetching 0 record selectd.

based on above value, these below detailed data should read.

Nbabutc_1-1645075520659.png

I used these code for fetching data...

 

if (ObjLocalConn != null){
ObjRS = Sys["OleObject"]("ADODB.Recordset");
ObjRS["Open"](TableName, ObjLocalConn, 3, 1, 2)
ObjRS["MoveFirst"]();
IntRowLoop = 0
while(!ObjRS["EOF"])
{
strTableData = ObjRS["GetString"](2, -1, ":", "\r\n")

}
}

 

suppose if I select diff row, like

Nbabutc_2-1645075770414.png

it fetch the record of select test case but while fetching detailed about that record 

Nbabutc_3-1645076041804.png

and for these it is fetching below data but its wrong 

Nbabutc_4-1645076215040.png

the actual data is:

Nbabutc_5-1645076690360.png

 

I dont why it is reading wrong data..

 

 

 

  • ohhh actually, it was reading as a database rows,so now its is working 

    Nbabutc_0-1650887017970.png

    it defined as tables, 

     

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    Are the intended record and the fetched wrong record always off by 1 record?

  • Nbabutc's avatar
    Nbabutc
    Occasional Contributor

    ohhh actually, it was reading as a database rows,so now its is working 

    Nbabutc_0-1650887017970.png

    it defined as tables,