Results 1 to 2 of 2

Thread: how to insert database chekpoint

  1. #1

    how to insert database chekpoint

    hi
    can anyone tell me how to insert database checkpoint?
    I work on some UK banking domain ,i have to create a user from web application and check from database whether the user created is active or not?
    everytime user is created in our application is added in db with there status .if use have not mentioned addres its status in db is incomplete so i need to check this from QTP ?
    so pls guide me for how to check in database(sql server)


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: how to insert database chekpoint

    Hi sangeetha, you can use this code for the connecting to database thru qtp....

    Set objconnection=createobject("adodb.connection") dsn_conn="driver={drivername}:server=servername,uid=uidname,password=password" objconnection.open dsn_conn set rs = createobject("adodb.recordset") set rs1=objconnection.execute("sql statement")
    username=rs.fields.item("employee name")

    for example you can check this code for connecting flight reservation database thru qtp (using msacess)

    dim dsn_conn,rs
    set objconnection=createobject("adodb.connection")
    dsn_conn= "dsn=qt_flight32;dbq=c:\program files\mercury interactive\quicktest professional\samples\flight\app\flight32.mdb;driver=c:\winnt\system32\odbcjt32.dll;driverid=281;fil=ms access;maxbuffersize=2048;pagetimeout=5;"
    objconnection.open(dsn_conn)
    set rs=createobject("adodb.recordset") set rs3=objconnection.execute("select top 5 flight_number from flights order by flight_number desc")

    ''it will give top 5 flightnumbers from flights table

    row=1
    r=1
    datatable.getsheet(1).addparameter"flight_numbers",""
    while not rs3.eof
    datatable.setcurrentrow(r)
    datatable.value(1,1)=rs3.fields.item("flight_number")
    r=r+1
    rs3.movenext
    wend

    ''run and see the runtime datatable.
    'i hope you got some idea..
    ___________________

    Arun Singh Rajaputra

    Last edited by rajaputra; 02-25-2008 at 12:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact