Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set a value for a null value in a function in QTP
#1
Not Solved Exclamation 
Hi,

Please help to resolve the following issue..It's urgent..


I have a function for connectivity to DB.Now for result of some query there is now row in table in DB .so for that while returning value QTP shows error ...
Can i set there any default value so that no error get populate..not in DB i want to set a variable while returning value if no result found...if it can be done then plz give me the idea...


Thanks,
Galstar
Reply
#2
Not Solved
Assuming you are using a recordset. You probably need to do this:
Code:
if RS.bof then
'no records
else
'do something
end if

Database queries (recordset) return a BOF (beginning of file) if there are no rows.

Hope that helps.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 6,180 06-26-2015, 12:31 AM
Last Post: babu123
  Webfile.set is not working in QTP 11 for chrome browser version 24 pradeep singh 1 5,150 11-05-2014, 11:51 AM
Last Post: mansoor.s.shaikh
  how to remove null values in array venkatesh9032 0 2,914 02-19-2014, 06:51 PM
Last Post: venkatesh9032
  QTP Report to respective QC test Set Path through VBS Anand Saboo 0 2,440 11-01-2013, 02:36 PM
Last Post: Anand Saboo
  QTP unexpectedly closes itself on function "Set" mlo 1 2,215 04-04-2013, 04:51 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)