How to connect to data base?
Answers were Sorted based on User's Feedback
QTP supports interaction with Database using ADODB.
Set con = createobject("ADODB.Connection")
Set rs = createobject("ADODB.Recordset")
'Create DSN(DataSourceName) for your database and specify
the DSN here
'You can also establish connection using Provider name
con.open "DSN=MyDsn;UID=ravi;PWD=sample123"
con.execute "Insert into emp values(2500, 'Ravi')"
'Retrieve data from database
rs.open "select * from emp", con
while not rs.eof
msgbox "ID = " & rs(0) & " Name = " & rs(1)
rs.movenext
wend
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / m.s.patil
You can write OLEDB script:
Set Con =CreateObject("ADODB.Connection")
ConString="Provider:SQLNCLI;Server=plantdev;DataBase=QAServe
r;UID=patil;PWD=password1"
Con.ConnectionString=ConString
Con.Open
| Is This Answer Correct ? | 0 Yes | 1 No |
what r the send key commands in QTP why they r used
what is run action?
How does you pass optional arguments in qtp?
Today only i joined in this site. Can u please tell me definition of parameterization. and how i can do the parameterization?
if we can find the status of script in qtp that either it's pass or fail then why we need to put this status on different excel file or log file in hybrid framework .please let me know asap thanks
How to capture a window in QTP?
how to capture tool tip in QTP and which check point is needed
what is delay in QTP?
What is throw Object?
What is the Difference between current version of QTP and QTP 8.2. Pls kidly Anybody let me know. Thanks in advance.
How to insert a check point to a image to check enable property in QTP?
what is the default ordinal identifier.what are the send keys in qTP.