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 |
In descriptive programming how we know the properties of the objects, if application is not developed and the prototype of the application is also not developed.
3 differences between QTP & Winrunner?
how can we perform web datatable operations on webpages(Like rowcount,col count,cell data)?
how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel
can u Give Procedure to Handle Pop Window & write Code for that
What is the difference between low level recording and analog recording mode when it will be enabled.
How to find array size in qtp?
How do you delete unwanted results in qtp?
What is Environment Variable and when we apply this in QTP?
Can we do Load Testing with QTP?
How to create a Runtime property for an object in QTP?
It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.