Give me an example where you have used a COM interface in your QTP project?

Showing Answers 1 - 14 of 14 Answers

latha

  • Sep 15th, 2005
 

com inteface appears in the scenario of front end and back end.for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface.of which COM wil be one among those intefaces.

praveen kumar masari

  • Jan 10th, 2007
 

hi,

   i will give you example of com.COM means "component object model",access the methods and properties to your application.

Ex:1.how to accessing the methods in your com object

note:our COM object name is "ADO("Activex Data Object")

QTP CODE:

Dim Cn,Rs

set Cn=CreateObject("ADODB.Connection")

1.note:syntax:set objectName= CreateObject("ProgramId")

2.note:every com object having one program id

set Rs=CreateObject("ADODB.Recordset")

Cn.ConnectionString "path of the Database"

Note:1.Cn is the Object name

         2.use this Cn object we can access the methods and properties of our COM object

Rs.Open "quer name",cn

Rs.Move First

Note:Rs.Move First means move the first record

  Was this answer useful?  Yes

Hi..

   we use COM interface when we are interacting with Excel files.

u can say like this..

   When ever we use createobject method..it is nothing but creating a COM Object.

the above examples also currect. But in general we dont interact with database. Excel file interaction is common for all object for all objects.

  example of COM:

ofso = createobject("excel.application")

   if any queries regarding this ping me: nanda.dreddy@gmail.com

  Was this answer useful?  Yes

com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions