-
Expert Member
Retrieve the data from database
How to retrieve the data from database in qtp
-
Expert Member
-
Expert Member
Re: Retrieve the data from database
Naweb and all, need help for the below code - got them somewhere on this site and modified for specific need... However, it has not been tested bucuase still have questions. Please focuss within the "select" and display data (last part) const adopenstatic = 3 const adlockoptimistic = 3 const aduseclient = 3 set objcon=createobject("adodb.connection") set objrec=createobject("adodb.recordset") ' establish connection - what shoud be for driver - give example? path? select case option case 1 objcon.open "driver={oracle in orahome92};server=oservername;uid=userid;pwd=upwd;dbq=database" case 2 objcon.open "driver={oracle in orahome92};server=oservername;uid=userid;pwd=upwd;dbq=database" case 3 objcon.open "driver={oracle in orahome92 (what shoud be here};server=oservername;uid=userid;pwd=upwd;dbq=database" case else msgbox("invalid ???.....") existtest end select objrec.cursorlocation = aduseclient -> what this is doing? ' fetch tempt uid objrec.open "select substr(body, instr(body, 'user id: ')+9, instr(body, 'password: ')) as id, substr(body, instr(body, 'password: ')+10, instr(body, '3. Follow')) as pwd from database.datable", objcon, adopenstatic, adlockoptimistic msgbox "result" & objrec.fields.item("id") & vbcrlf & objrec.fields.item("pwd") & vbcrlf ' flush out objrec.close objcon.close set objrec=nothing set objcon=nothing msgbox "executed sucessfully"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules