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.
Solved! Go to Solution.
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.
What were you expecting? Syntax wise, you have it incorrect. It should be
Qry1.Execute("<the sql statement to be executed>")
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.
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.
See my suggested correction above. Did that work for you?
Yes Sir. I tried with correcting the error and was getting that error.
same connection works for select statement.
Make sure that the user you use for connection has necessary privileges (to run UPDATE SQL queries)
When i tried running the same query manually in data base it runs with no issue. Basically the issue opens ont he line
qry1.Open()
the database login opoup opens and enters the username but not entering the password.
the password given is the right one. verified it.
and then throw check synchronize called error.
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.
Subject | Author | Latest Post |
---|---|---|