Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with QTP SQL ADO connection, value retrieved is different
#1
Not Solved
I am writing a script to compare values in an excel file and values retrieved from a SQL database

The value in question is - "A the HR. (No Ad)"

The value is taken directly from SQL query and copied into the excel sheet for comparison purposes.
When I read the value from the excel sheet (also using OLEDB connection for Excel) it is displayed as

"A the HR. (No Ad)" (A)

But when I read the value from SQL using connection string the value is displayed as

"A the HR.(No Ad)" (B)

Even though the value in the DB is displayed correctly as (A) which is as expected using a query search.
For some reason when getting the value using connection string the space is removed from the string.

- If I remove the space using replace or trim the If A=B statement still fails (even though the 2 strings are now the same)
- I have tried searching for a vbCrlf in the string and removing it but still the condition fails.

Can anyone explain this wierd behaviour and give a solution?


Thanks,
Charan
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question JDBC connection for UFT Anjali09 0 3,629 10-05-2016, 02:19 PM
Last Post: Anjali09
  Getting error while connecting from qtp to oracle sql developer. Ritanjali Pradhan 1 3,186 09-26-2014, 02:06 PM
Last Post: vinod123
  Not able to connect to Oracle SQL Developer Paras Singh 0 6,767 05-30-2013, 01:25 PM
Last Post: Paras Singh
  Generic Function to read the data from Excel/sql database using ADODB connection supputuri 0 13,318 05-25-2012, 10:59 AM
Last Post: supputuri
  QTP connection to QC kirangoud 4 15,415 03-02-2012, 03:36 PM
Last Post: kirangoud

Forum Jump:


Users browsing this thread: 1 Guest(s)