how we connect oracle or sql data server database to qtp.

Answers were Sorted based on User's Feedback



how we connect oracle or sql data server database to qtp...

Answer / ram

open qtp-->click record

In Insert Menu-->OutputValue-->Database Output value--
>select specify query manually radio button-->and click at
create button->click new-->select sqlserver from the popup
and click next-->next

u will get connection
DSN=database;UID=username;Trusted_Connection=Yes;APP=QuickTe
st Professional;WSID=computername;

and write sqlstatement

select columnid from tablename (dont put * instead of
columnid)

then automatically the below line is added in qtp
DbTable("DbTable").Output CheckPoint("DbTable")
and do remaining stuff.

u need some more clarification please send the mail to
i.krishna@rediffmail.com

Is This Answer Correct ?    10 Yes 8 No

how we connect oracle or sql data server database to qtp...

Answer / mohit

You may try:

Dim rs,sq,pkey
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
' Oracle client is required to be installed on your box
conn.open= "Provider=OraOLEDB.Oracle.1;Password=***;Persist
Security Info=True;User ID=****;SERVER=****;Data
Source=****;DBQ=****;"
sql="your sql"
rs.open sql,conn

rs.close
set rs=nothing

conn.close
set conn=nothing

Is This Answer Correct ?    7 Yes 6 No

how we connect oracle or sql data server database to qtp...

Answer / deepu

Hi Ram I was your answer for this. Can you kindly let me
know in details steps on How we can connect to database. i
am using QTP9.2 and SQL Server Database. I am new for QTP
and this would be of great help.Thanks

Is This Answer Correct ?    2 Yes 4 No

how we connect oracle or sql data server database to qtp...

Answer / 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

More QTP Interview Questions

How to handle the errors without using recovery scenery?

3 Answers  


Give me some scripts for 1). checking webpage links (counting links,opening web pages,counting child elements)

2 Answers   CIL,


what is On Error Resume Next ?

4 Answers   Accenture,


How you can write contexts to text file in qtp?

0 Answers  


How many types of Recordings are there in QTP and what are they?

7 Answers   Dangote, First Indian Corporation,






What does it mean when a check point is in red color? what do u do?

1 Answers  


Is it possible to change the name of a test object. I mean when we are recording the script for an object (for Ex: Username is a text field which has value "Babu",i am recording that). Then the Name of the object will become "Babu" in object repository. If i want to change "babu" as "xxxxx" .. is it possible to do? Pls help me in this .. if you didn't understand the question, pls let me know.

4 Answers  


What are the technologies supported by qtp?

0 Answers  


Hi, I got some difficulties in automating a web check box in a peoplesoft application. Let me explain the scenario, When clicked on a look up button in the application, it navigates to a new page with check boxes and respective options. Below is the source code for one check box and its option. <input type='checkbox' name='H1AU_BUNDLE_WRK_H1AU_SELECT_CH$2' id='H1AU_BUNDLE_WRK_H1AU_SELECT_CH$2' tabindex='34' value="Y" onclick="this.form.H1AU_BUNDLE_WRK_H1AU_SELECT_CH$chk$2.valu e=(this.checked?'Y':'N');submitAction_win0 (this.form,this.name);" /> </td> <td align='left' class='PSLEVEL1GRIDODDROW' > <span class='PSEDITBOX_DISPONLY' >$29 - $29 Cap with FREE Mobile</span> I want to parametrize using "$29 - $29 Cap with FREE Mobile". I am not aware of how to parametrize this. Currently I am parametrizing with 'H1AU_BUNDLE_WRK_H1AU_SELECT_CH$2' Can any one please help me out with this??/

0 Answers  


what r the main attributes of test automation?

0 Answers  


Could anyone help me for the below scenario: i am using the descriptive programming for my account, in which we have to generate the contract in the MS-word. when i generate this doc, we need to click on enable macros to continue further. but i am unable to make qtp to click on this. if anybody faced the problem like this??? pls help to get it resolved? Thanks in advance

0 Answers  


why don’t use real time they r not using check points

1 Answers   Wipro,


Categories