Does qtp allows us to execute sql statements(like select..) with the help of any vb functions? winrunner does this with the help of db_connect(),db_execute_query(),db_write_records().

Showing Answers 1 - 2 of 2 Answers

asha

  • Feb 11th, 2006
 

Ya QTP has this facility

for this u r require to create dsn and then recordset for more information refer

QTP plus help file it contain code how to write SQL statment for the QTP

means "database connection" help

  Was this answer useful?  Yes

yeah, We can have through ADODB Engine for ex;code like this..

Function Connect_to_db()

    Set cnn = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    cnn.ConnectionString ="DRIVER={Oracle in OraHome92};SERVER=your server ;UID=username;PWD=password;DBQ=dbserver"
    cnn.open
    query = "select * from Employee"
    rs.open query,cnn
    rs.movefirst
    msgbox rs(0)
 
End Function

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions