I would like to get MAX ID from a table Marks with column name as ID.
I wrote the below piece of code. But, not understanding how to get the value from objRecordSet.
Could any one of you help me?
My Code is as below:
'create connection and recordset
Set objCon = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objCon.Open "Provider=SQLOLEDB.1;Data Source=localhost;Initial Catalog=store","userId","password"
'select statement to retreive our data
sql = "select MAX(ID) from Marks"
objRecordSet.Open sql, objCon, 3, 3
After that how can I get the value?
-- Here to Learn and share ---
Tarun Buy the NEW QTP Descriptive Programming Unplugged Book ** Download QTP Unplugged 2nd Edition eBook for FREE **
Thank you Tarun. Its working.
Thank you Jonty for giving more information on ADO.