' Database connection using Testcomplete
Sub main
Set AConnection = ADO.CreateADOConnection
AConnection.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=DG18\SQLEXPRESS"
AConnection.LoginPrompt = False ' Suppress the login dialog box
AConnection.Open
Set RecSet = AConnection.Execute_("SELECT * FROM holding") ' Execute a simple query
RecSet.MoveFirst
While Not RecSet.EOF
Log.Message RecSet.Fields("Script").Value
RecSet.MoveNext
Wend
AConnection.Close
End sub
How to get count of a particular control say,textbox in a form?
ReplyDeletefor that you can loop through the child controls on the form and if child control type is textbox then increase the textbox_control_counter with 1
ReplyDeletethe code may be like:
counter = 0
for i = 0 to form.childcount
if form.child(i).type = "Textbox" then
counter = counter + 1
end if
next
msgbox(counter)
Hey Dharamveer, can you give me your mail address ?
ReplyDeleteHi "v", I have shared my mail ID.... you can get it by viewing my profile...
ReplyDelete(Goto "view my complete Profile")
Hi
ReplyDeleteI have more than one type of DB , like CSV, Excel, MSSQL etc.
Based on the type of database that DB should be logged in that is my requirement.
So do I have to write separate connection functions for each sort of data?
Execute_-->this doesnt work for me.
ReplyDelete