I have this code, i want to read the maximun number of a index in one table.
My table name is consultas and the key name is nroconsulta,
i know that in the oRS is the result of the select but,
How i cant get it??
This is the code:
Set oConn = Server.CreateObject("ADODB.Connection"
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\kvillalobos\db\dbcsi.mdb"
)
'Select the last index number in the db
sSQL ="select max(nroconsulta) from consultas"
Set oRS = oConn.Execute(sSQL)
if NOT oRS.EOF then
' Response.Write(oRS("nroconsulta"
)
'That is the big question,how i can get the number that have oRS, the result of the max function in sql.
end if
My table name is consultas and the key name is nroconsulta,
i know that in the oRS is the result of the select but,
How i cant get it??
This is the code:
Set oConn = Server.CreateObject("ADODB.Connection"
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\kvillalobos\db\dbcsi.mdb"
'Select the last index number in the db
sSQL ="select max(nroconsulta) from consultas"
Set oRS = oConn.Execute(sSQL)
if NOT oRS.EOF then
' Response.Write(oRS("nroconsulta"
'That is the big question,how i can get the number that have oRS, the result of the max function in sql.
end if