How to connect to data base?

Answers were Sorted based on User's Feedback



How to connect to data base?..

Answer / jayadev acharam

Using ADODB Object
Example
DB_Connect=CreateObject(ADODB.Connection)

Is This Answer Correct ?    4 Yes 0 No

How to connect to data base?..

Answer / akshay

Public Function database(Str,SQLstr,outResult1,outResult2)

'//Variable Declarations
Dim objConn, rsOut

'//Create a connection object.
Set objConn = CreateObject("ADODB.Connection")

'//Create a ResultSet Object to store the results.
Set rsOut = CreateObject("ADODB.Recordset")

'//Open the Created Connection object
objConn.Open Str

'//Pass the SQL query string and retrieve the Results
through the connection object
rsOut.Open SQLstr,objConn

If rsOut.EOF <> True AND rsOut.BOF <> True Then

'//Store the different column values
retrieved from a record in different variables.
outResult1=rsOut("col1")

outResult2=rsOut("col2")

rsOut.movenext
End If

End Function

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More QTP Interview Questions

What is the qtp testing process?

0 Answers  


how to test power point using QTP 8.2 ? What are different methods to retrieve value from Application during runtime ?

3 Answers   HCL,


The xls contain data. how to get number of columns form the sheet?

4 Answers   Virtusa,


in QTP,how to write a descriptive program for "yahoo" or "gmail" Login page

1 Answers  


When we use Object Spy? can we write QTP script before built is came in testing?

3 Answers   Impulse,


I want some banking domain projects where can i get this projects ( anybody can help me plz)

3 Answers  


What are the advantages of Automation objects than Test Objects?

2 Answers   Adobe,


what is database check point, how will you parameterize the database from seperate data table?

2 Answers   JPMorgan Chase,


what is use of optionexplicit in variable declaration

5 Answers   GE,


How to connect the remote desktop using QTP 9.2 explain the method or procedure?

0 Answers   Magna Infotech, Oracle,


Anybody wants to learn QTP with realtime implementations and complete framework desiging plz contact to this mail id ciraaj@gmail.com

1 Answers  


I am having major problems with some DB Table Checkpoints I add to my script. I 35 web based applications recorded and each has DB Table Checkpoints insert but only 1 script isn't recognizing the DB Table Checkpoints for some reason. I've checked the DB connections and the info in the Library Functions and still only this one script out of 35 doesn't recognize the DB Table Checkpoints. Can someone please help me figure out why only this one script out of 35 that's hitting the same database is having a problem.

0 Answers  


Categories