Hi Bala, This is working. I could fetch values from the columns specified. Thanks for your valuable answer.
Thanks and Regards, Dhanya On Jul 23, 10:25 am, balakrish <[email protected]> wrote: > Hi Dhanya , > > Try this script , > > Dim con,rs,column_count,column_name, i > Set con=createobject("adodb.connection") > Set rs=createobject("adodb.recordset") > con.open"provider=sqloledb.1; > server=dbserver;uid=****;pwd=***;database=****" > rs.open"select*from tablename",con > > column_count = rs.Fields.count '''''''To get the column > count > in specified table > msgbox column_count > > For i = 0 to column_count - 1 > column_name = rs.Fields(i).Value ''''''To get the columns > names in > the specified table > print column_name > rs.movenext > Next > > (or) > > Here we are going to take the particular column value, we can fetch > the data whatever we want from this script > > Dim con,rs,column_count,column_name, i > Set con=createobject("adodb.connection") > Set rs=createobject("adodb.recordset") > con.open"provider=sqloledb.1; > server=dbserver;uid=****;pwd=***;database=****" > rs.open"select*from tablename",con > > while not(rs.EOF) > msgbox "value=" &rs.fields.item("dname")&vbcrlf > rs.MoveNext > wend > > rs.Movefirst > > while not(rs.EOF) > msgbox "value=" &rs.fields.item("dsalary")&vbcrlf > rs.MoveNext > wend > > rs.Close > con.Close > set rs=Nothing > set con=Nothing > > Msgbox "values are fetched" > > Regards > Bala --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en -~----------~----~----~----~------~----~------~--~---
