SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Jun 2003
    Location
    India
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Perform DataBase Insert using QTP

    Hey All,
    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 ?
    -Thanks!
    Regards,
    Shashi

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Location
    Atlanta
    Posts
    176
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Perform DataBase Insert using QTP

    Hi Shashi,
    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
    Dim obj
    Dim rec
    ' create connection object.
    Set obj = CreateObject("ADODB.Connection")
    ' Open databse using connect string
    obj.Open ("DSN=urdsnname;UID=test;PWD=test;")
    obj.Execute "insert into <tablename> values (val1,val2,val3)"
    'to check
    MsgBox rec(0).Value


    thanks & Regards,
    Prasanna.T.R
    Cheers,
    Prasanna -

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:44 PM.

Copyright BetaSoft Inc.