Perform DataBase Insert using QTP
I have come across a Scenario in which I have to Perfrom DB Insert/Update actions during Test Run.
I tried writing the same using VB Code but that also does not seem to work as I dont have Visual Basic installed on my machine.
I have the DSN of the Data base but what Next [img]images/icons/frown.gif[/img]
Any Thoughts Guys ?
Re: Perform DataBase Insert using QTP
I think ur asking something based on connection string and perform some SQL queries using VB in QTP.
Use the following code in any action or make it as an external script it should work
' Define connection and record set as objects
' create connection object.
Set obj = CreateObject("ADODB.Connection")
' Open databse using connect string
obj.Execute "insert into <tablename> values (val1,val2,val3)"
thanks & Regards,