QTP Script to Update Database Data-Updating Database Table Data Through QTP

VBScript to update data in database table.

We have table "EMP" in database "db"(Microsoft Access).

EMP Table has following data in it.


EMPNO EMPNAME EMPSAL
1 Lakshmi 30000
2 Laxmi 25000
3 Latha 15000

Check This Blog For SQL Queries

Check this post for Script to get column names from database table(MS Access).

Dim con,rs

set con= CreateObject( "ADODB.Connection")

set rs =CreateObject("ADODB.Recordset")

con.provider="microsoft.jet.oledb.4.0"

con.open"d:\db.mdb"

rs.open "update EMP set EMPSAL=50000 ",con

msgbox("Updated")


Above script(code)will update database table(EMPSAL=50000).

Output:

EMPNO EMPNAME EMPSAL
1 Lakshmi 50000
2 Laxmi 50000
3 Latha 50000


QTP Script to count no. of checkboxes in a webpage
SQL Queries Collection
QTP Script for Connecting to database
QTP Script to export database data to excel sheet
QTP Script to import database data to datatable
Connecting to MSAcess,Oracle,SQL Server Database
Hindi and Telugu Songs Lyrics
QTP Script to get column names from database table(MS Access).

No comments:

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge