Forum Discussion

GAutomation's avatar
GAutomation
Frequent Contributor
6 years ago

how to run the update statement in test complete

VB script

 

Function Sq_QryUdate(field,value )
'Create a query

Set Qry1 = ADO.CreateADOConnection

'Specify the connection string

Qry1.ConnectionString = "Provider=IBMDA400.DataSource.1;Persist Security Info=False;User ID=XXX;Password=XXX;Data Source=XXX"

Qry1.Open()
'Specify the SQL expression
Qry1.Execute="Update statement"
Qry1.Close()


 

The above does not work as expected.

  • GAutomation's avatar
    GAutomation
    6 years ago

    Got it worked. I went to database checkpoint and try connecting and ran teh code again without any changes it worked. not sure what the issue was. but its working.

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Just as a side note... the online documentation for TestComplete that I've been linking you to is pretty well written with code examples and such in multiple languages.  If you haven't done so already, I'd highly recommend two things.

      1) Take a look at the internal documentation for TestComplete for using ADO for connectivity.  Several topics in the help files cover the different methods.  For the ADO object you are using, you can start here https://support.smartbear.com/testcomplete/docs/reference/program-objects/ado/index.html

       

      2) That link I sent you has several links embedded which will take you to other specific documentation for the Microsoft and Borland ADO objects and methods.  

    • GAutomation's avatar
      GAutomation
      Frequent Contributor

      I am getting an error checksynchronize called from  thread $1888, which is not the main thread and i have to kill test complete  when i get this error.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        See my suggested correction above.  Did that work for you?