how we connect oracle or sql data server database to qtp.
Answer Posted / kiran kumar gunda
Kiran Kumar Gunda Mail ID: kiranbec2003@gmail.com
'CONNECTING TO THE CHORDIANT DATABASE - SYMPHONY
'Create the ADO object
Set dbconn = CreateObject("ADODB.Connection") 'connecting
to database by opening the connection string & executing
queries
Set recset = CreateObject("ADODB.Recordset") '
Insert,delete, update..for DML statements
SQLQuery="select * from sym_pduser.branch_information"
'Set the DSN Name
'Environment.Value("DSB_DSN")
="DSN=DEV4;UID=SYM_PDUSER;PWD=userpd0;DBQ=DEV4;DBA=W;APA=T;E
XC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=I
fAllSuccessful;MTS=F;MDI=F;CSR=F;FWC=F;PFC=10;TLO=0;"
Environment.Value("DSB_DSN")
="DSN=CHORD_TEST2;UID=SYM_LDUSER;PWD=userld0;DBQ=CHRDANT_TES
T2 ;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;
GDE=F;FRL=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CS
R=F;FWC=F;FBS=64000;TLO=0;"
'Environment.Value("DSB_DSN")="CHRD_DEV1 =(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =
169.185.214.149)(PORT = 1525)))(CONNECT_DATA =(SERVICE_NAME
= chrd0)))"
dbconn.Open Environment.Value("DSB_DSN")
recset.CursorType = 1
'recset.open "select * from
sym_pduser.perf_user_today",dbconn
'dbconn.open
recset.open ""&SQLQuery,dbconn
msgbox "Database Connection Successful"
RecCount=recset.RecordCount
msgbox RecCount
Set RecCount=Nothing
Set recset =Nothing
Set dbconn=Nothing
Creation of DSN String
1) Place the tnsnames.ora file in the
D:\oracle\product\10.1.0\db_1\NETWORK\ADMIN folder
2) Add the Data Source name in the in the System DSN
Go to Control panel -> Administrative Tools ->
Data Sources -> System DSN -> Add
a. Select a Driver for which you want to setup a data
source – Oracle 10g
b. Enter Data source name : CHORD_TEST2
c. Description : Chordiant_Test2
d. Select TNS service name, enter User ID
User Id: SYM_LDUSER
Password: userld0
3) Create a .Udl file and select – select a Provider
Microsoft OLE DB provider for Oracle(Provider for ODBC
Drivers
Click on UDL file and select Connection -> Select use
connection string radio button, click on Build
a) Select machine Data Source
b) Select previously created Data source i.e.,
CHORD_TEST2
c) Enter password, Your Connection string will be
built.
Below is the generated DSN String
DSN=CHORD_TEST2;UID=sym_lduser;PWD=userld0;DBQ=CHRDANT_TEST2
;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GD
E=F;FRL=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=
F;FWC=F;FBS=64000;TLO=0;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What are the various automation frameworks available in qtp?
Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop.My scenarios is like that,it should contain following steps. 1)Automatically it should click on start and then on remote desktop connection. 2)it should enter the IP address and then connect to remote desktop. 3)and then it should be able to record the application in remote machine and then run it also. Can somebody tell me how to record the application which is in remote machine.
Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com
Why to use descriptive programming?
How many ways is to parameterize the value?
wht is Manual Testing Frame work. Pls anybody can give appropriate answers
What are the types of object repositories? Which one is you are using?
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object.. (give a filter condition only WEbelement- not easy need to use some more property while giving filter condtions- use google for your help...))
Explain the concept of object repository and how QTP recognizes objects?
Some time when i wanna learn the object i face issue like i am not able learn the object in proper manner... eg:for text bo on web page it should learn as webedit but some times it reads as winobject:internetexpoler-server, because of this i have to uninstall the qtp and re-install it again when i do this it reads the object perfectly.....plz suggest the soln
The hybrid framework can be implemented for any application. Is it true?
When and why to use descriptive programming?
How QTP support all types of applications (platforms)?
can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?
Can any one explain me what is the procedure to connect the remote desk by using QTP 9.2 ?