Hi Abhijit,

Please find the following simple example.

Set objConnection=createobject("ADODB.Connection")
Set objRecordSet=createobject("ADODB.RecordSet")
strConnectionString="Server=AAA;Database=BBB;user id=cccc;password=ddddd" 
'Here i have give syntax for SQL Server;
'For various other Databases find the following Website for accurate 
connection strings "http://www.connectionstrings.com/";
objConnection.Open strConnectionString
Set objRecordSet=objConnection.Execute("select * from employee") ' Your SQL 
Query
Do while not objRecordSet.EOF
        print objRecordSet.Fields("EmpID").Value  'Here you can specify the 
field number also inplace of field name
        objRSTestCasesCol.MoveNext 'MoveNext points to the next record
Loop
Set objConnection=nothing
Set objRecordSet=nothing

Thanks,
Uday
QTP / UFT Videos <https://www.youtube.com/user/AnemUday/videos>

On Monday, 2 June 2014 12:41:43 UTC+5:30, Abhijit Biradar wrote:
>
> Hi All,
>
> Can any body tell me how to automate database testing in qtp.
>
> Thanks in advance. 
>
> Regards,
> Abhijit Biradar
> +91-7875563598
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to