Program to Connect SQL-Server From QTP set con=createobject("Adodb.connection") set rec=createobject("Adodb.
recordset")
con.open"provider=sqloledb.1;server=mindq9;uid=sa;pwd=;database=satish"
rec.open"select * from emp",con While rec.EOF <> true Empno=rec(0) Empname=rec(1) msgbox Empno msgbox Empname rec.MoveNext Wend Set con = nothing Set rec = nothing --------------------------------------------------EOF return True when the Rec Pointer Present at Ending Of File. BOF return True when the Rec Pointer Present at 1 St Rec . --------------------------------------------------Provider Names For Different Data Bases.
Data Base SQL Server Ms-Access Oracle
Provider Names
sqloledb.1 or SQL Server
Microsoft.Jet.oledb.4.0 MsdaOra or Oraoledb.1
--------------------------------------------------Program to Connect MS-Access From QTP set con=createobject("Adodb.connection") con.Provider="Microsoft.Jet.oledb.4.0" con.Open "d:\testdata.mdb" set rec=createobject("Adodb.recordset") rec.open"select * from emp",con While rec.EOF <> true Empno=rec(0) Empname=rec(1) msgbox Empno msgbox Empname rec.MoveNext
Wend Set con = nothing Set rec = nothing