What is the return value of record set object,when value in data base does not exist? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: What is the return value of record set object,when value in data base does not exist? (/Thread-What-is-the-return-value-of-record-set-object-when-value-in-data-base-does-not-exist) |
What is the return value of record set object,when value in data base does not exist? - Star - 08-26-2009 Hi, I have a problem in recordset object, when result of query is null means no data in database. Following is my code: Code: Set Conn = CreateObject("ADODB.Connection" ) i m executing a query "select name, id, parentId from `Folders` where name = 'test' and parentId = 0 and id = 1;" when this value exists in data base then my code is working fine. But how can i check that this value exists in databases or not? means if test in "name" colum does not exist then what would b the return value of recordset object? and how can we check that? i did like following, if recordSet = "" if recordSet <> "" if recordSet <> Nothing if recordSet <> Null but these all are not working. Please help me asap, Thanks RE: What is the return value of record set object,when value in data base does not exist? - Saket - 08-26-2009 Quote:how can i check that this value exists in databases or not?use recordset.EOF this will return true if no data exists RE: What is the return value of record set object,when value in data base does not ex - basanth27 - 08-26-2009 Saket solution will lead you to what you need. If you want to know the other way of finding wether it returned a value or not then you can try the below, Code: oCount = 0 On the Contrary you may try even this, This will give you the exact value returned from the RecordSet executed query. Code: Set oDB = CreateObject("ADODB.Connection") |