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
HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?
How many add-ins comes by default with quicktest professional (qtp)?
I am getting an error "failed to open the XML checkpoint result viewer" in result window,after clicking on "View XML checkpoint results".Someone suggest me settings,if any...
What r the different filters in defect in quality center
when a test case is written how u test using qtp
What is clean sweep?
write a script for allinterview-submit Question first we've to select Choose Category,second select Sub- Category(Which is comes in to runtime)third select Question Type.for that give some descriptive and vb script
What is checking bitmaps?
How to use the object spy in quicktest professional 8.0 version?
Explain the difference between call to action and copy action?
What is the quicktest professional (qtp) testing process?
what is the difference between development and testing
How does qtp identify the object in the application?
This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10
what is profile tool?