GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 621 of 646    Print  
Database connectivity using QTP
How to give database connectivity using Q.T.P


  
Total Answers and Comments: 2 Last Update: June 18, 2008     Asked by: mohapatra_s 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 30, 2008 10:01:20   #1  
md_vinodh Member Since: April 2008   Contribution: 32    

RE: Database connectivity using QTP
Dim objConn,objRecSet

Set objConn= CreateObject("ADODB.connection")

Set objRecSet = CreateObject("ADODB.recordset")

objConn.open " Server: , Database: , User Name , Password " ' connection string about ur Datanbase

objRecSet.open "Select * from Table Name "

Finally
objRecSet.close
objConn.close

 
Is this answer useful? Yes | No
June 18, 2008 05:08:20   #2  
surenhere07 Member Since: June 2007   Contribution: 2    

RE: Database connectivity using QTP
This is for Access DB

Set objDB = CreateObject("ADODB.Connection")
'Here, the DB is MS Access and DSN less connection
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:Sample.MDB" objDB.Open ConnectionString
'if you create DSN use as follows,
'objDB.ConnectionString = "<DNS Name>" in this case comment above- '
-ConnectionString  line

If objDB.state=1 Then
msgbox("Connection Is Establsihed")
else msgbox("Connection is not opened") 
End If
sql_query = "<Your SQl Query>"
Set objResults = CreateObject("ADODB.RecordSet")
Set objResults = objDB.Execute(sql_query )
Do Until objResults.EOF
msgbox objResults("<colname>")
msgbox objResults("colname")
objResults.MoveNext
Loop
objResults.Close
objDB.Close
Set objResults=Nothing
Set objDB = Nothing

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : The below code...will connect to databaseSet xlconn=createobject("ADODB.connection")Set xlrset=createobject("ADODB.recordset")connstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsmavDesktopseshudb1.mdb;User ...
Read Answers (2) | Asked by : ilts

I am testing a Java executable application and and IE based application.I have a script that I would like to launch the Java executable, enter a record in the database, the switch over to IE and search the database. Currently I am having trouble: 1) The java EXE cannot be launched from the QTP command line. So my run settings are run on any open Java application. This is not preferable and right now DEV cannot figure out why QTP can launch other Java apps and not ours. So when I start the script

Can anybody tell me the purpose of output checkpoints in QTP. how u r testing the text data through text checkpoints. how u r testing text data in the webpage through parameterization. my application is web based application. my requirement is i am retriving the data from the database to webpage. i put text checkpoint on the text, but problem is the parameterization. can anybody help me with code. i will appreciate if anybody can say
Read Answers (2) | Asked by : manoj_k3

Latest Answer : I am trying to connect DB2 from QTP, How do i do thatAny Ideas ...
Read Answers (3) | Asked by : Resmi

Hi,I wanted know how does QTP identifies a DataCombo. While recording I clicked on the data combo and selected a value from the list. The click of Data Combo is recorded but the selection of the value from the list is not recorded. My application is based on VB and SQL server as the database. Please let me know as how do I record the action of selecting a value from a DataCombo list. The list is being loaded from the Database Record set.

Hi,I am new to QTP. I am trying to connect to the database through Database checkpoints and unable to connect to the database. Here we are using IBM DB2. It is giving error "Format of the initialization string does not conform to the OLE DB specification."And the created Connection string is "DRIVER={IBM DB2 ODBC DRIVER};DSN=dsnname;UID=uid;PWD=pid;MODE=SHARE;DBALIAS=dbname;"Can you please resolve my problem.Thanks in advance..
Read Answers (2) | Asked by : Praveen Y

Testing Abinitio tool with QTP.What's the process of testing ETL tools using QTP.I was able to launch Abinitio by providing the path of the .exe Abinitio file. QTP did recognize the object as Abinitio tool.My query is :QTP shd be able to access a FLAT file from the backend(Database Checkpoint) and retrieve only a specific set of records from the selected flat file.
View Question | Asked by : Khamaj

Latest Answer : Hi,Control pannel->Admin tools->ODBC;1)configure first two tab of ODBC settings to the respective SQL server2)QTP->Insert Database checkpoint and click on create button-> and config the database to which u need to run the query...ThxsSanjeev ...
Read Answers (3) | Asked by : leslie

Hi Guys I am New to testing field I want to know some information about How to use database checkpoints,data driven test in real time?Could you plzz explain with simple example except flight reservation.I would appreciate you could respond me as quick as posssible.plzzz help me Thanx
Read Answers (1) | Asked by : sunny

I have inserted database checkpoint. but the Query result is not changing after i am running the script I want runtime database checkpoint. Help me.
View Question | Asked by : seema


 Sponsored Links

 
Related Articles

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

What is Connectivity

Computer networks are the main connectivity mechanism for passing data in an electronic environment. A network is composed of several computers connected by a wired or wireless medium so data and other resources can pass through for sharing. A computer network may be as small as two computers conn
 

What is Operational Database

Operational Database is the database-of-record, consisting of system-specific reference data and event data belonging to a transaction-update system. It may also contain system control data such as indicators, flags, and counters. The operational database is the source of data for the data warehouse
 

Evolution of database systems

The Evolution of Database systems File Management System Hierarchical database System&nbsp; Network Database System&nbsp; Relational Database System File Management System: The file management system also called as FMS in short is one in which all data is stored on a singl
 

Database Concurrency and Reliability

Database Concurrency and Reliability Overview Concurrency and reliability have long been &ldquo;hot topics&rdquo; of discussion among developers and users of distributed systems. The fundamental problem can be seen in a simple example, as follows. Suppose two users are working on the same
 

Database Interaction

Database Interaction Efficient interaction, efficient storage, and efficient processing are the three key properties of a successful database platform. In this article, we explore the first: efficient interaction. Interaction Category 1: Command Line Clients Many database platforms are shipped with
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape