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

How many types of parameters are available in quicktest professional (qtp)?

0 Answers  


Where the text version of script file located in file system?

1 Answers  


What are the Levels of Automation in QTP

2 Answers  


cud anybody please tell me the full form's of the extention files that we use in real time---.tsr,.mtr,.qrs

7 Answers   Symphony,


How many types of recording facility are available in QTP?

1 Answers  






what is the syntax or command in vbscript to display user message example i want to display "welcome to QTP".

3 Answers  


How many ways to configure the application in QTP,Explain

2 Answers   CTS,


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?

0 Answers  


How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box

0 Answers   L&T,


Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?

0 Answers  


how to validate email?email ie correct or not ?with below conditions. 1)before @(symbol) only alphbates and min 4 char to max 15 chars. 2)before @(symbol) only alphabates dont use ant special chars or numarics 3) after @(symbol) only one dot(.)symbol for ex:abc@gmail.com it is valid email or not based above conditons

2 Answers   Aspire,


What type of error u will get if u have not installed java add in in java project? what is the error name ?

1 Answers   Verizon,


Categories