Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingQuickTest Pro @ OneStopTesting

Message Icon Topic: Donate a user defined function to this topic

Post Reply Post New Topic
Author Message
tanushree
Senior Member
Senior Member
Avatar

Joined: 04Apr2007
Online Status: Offline
Posts: 2160
Quote tanushree Replybullet Topic: Donate a user defined function to this topic
    Posted: 05Jun2007 at 4:00am
Function GetDataFromDatabase(sDatabaseName,sUID,sPWD,sSQL)	'Declare the array
dim DbArray()

TotalRow=GetRowsCountFromDatabase(sDatabaseName,sUID,sPWD,sSQL)
'Create the connection string:
strConn="DRIVER={Microsoft ODBC for Oracle};SERVER=" & sDatabaseName & ";User ID=" & sUID & ";Password=" & sPWD & " ;"

'Establish the connection:
Set oConn = CreateObject("ADODB.Connection")
'Server-side cursor
oConn.CursorLocation = 2
oConn.Open strConn

'Create a recordset to hold the results
Set rs = CreateObject("ADODB.Recordset")
'Options for CursorType are: 0=Forward Only, 1=KeySet, 2=Dynamic, 3=Static (read-only)
rs.CursorType = 3
Set rs.ActiveConnection = oConn
'Execute the query and put the results into the recordset
rs.Open sSQL

NumberOfColumn=rs.fields.count

' Verify record set is not null or empty
if rs.RecordCount <= 0 then
Reporter.ReportEvent micFail,"Data NOT FOUND for SQL:",sSQL
ExitAction(0)
end if

' Resize the array
ReDim DbArray(TotalRow,NumberOfColumn)

i=0
j=0
' Assign recordset to an Array
Do While Not rs.eof
For j = 0 to NumberOfColumn - 1
DbArray(i,j)=rs.fields(j).value
Next
rs.MoveNext
i=i+1
loop

'Close the Recordset
rs.close
' Clear the connection string
Set strConn=nothing
' Clear the connection to a database
Set oConn=nothing
GetDataFromDatabase=DbArray

End Function



Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
navinpandey2000
Newbie
Newbie
Avatar

Joined: 29Jun2007
Location: India
Online Status: Offline
Posts: 1
Quote navinpandey2000 Replybullet Posted: 03Jul2007 at 10:22pm

Hi , while i run my application (developed in ASP.net) after recording in QTP9.2 i m facing problem stated below...........I had also download add_in for .net but still it is not running.......please give me appropriate solution for this

Cannot identify the object "ctl00$ContentPlaceHolder1$srch" (of class WebList). Verify that this object's properties match an object currently displayed in your application.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.188 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting