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)
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")
[COLOR="Red"]for example you can check this code for connecting flight reservation database thru qtp (using msacess) [/COLOR]
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