daveigh
Programmer
- Oct 9, 2003
- 105
hey guys.
got some prob here. i'd like to select the max value of field named oid. the problem is when the oid has no value initially, what do i have to do so that i could trap it and create an initial value?
here is my current code which wont work, coz the oid field has no value.
set toprs = server.createobject("ADODB.Recordset")
topsql = "select max(oid) as temp from tablename"
toprs.open topsql,dataconnection
if toprs.eof then
tempnum = 10000
else
tempnum = toprs("temp") + 1
end if
______________CRYOcoustic_____________
got some prob here. i'd like to select the max value of field named oid. the problem is when the oid has no value initially, what do i have to do so that i could trap it and create an initial value?
here is my current code which wont work, coz the oid field has no value.
set toprs = server.createobject("ADODB.Recordset")
topsql = "select max(oid) as temp from tablename"
toprs.open topsql,dataconnection
if toprs.eof then
tempnum = 10000
else
tempnum = toprs("temp") + 1
end if
______________CRYOcoustic_____________