Set Objrs=Conn.Execute( "Select Max(ID) From 产品 Where ID< "& varID & " and 类别='" & typeid & "'") Set Objrs=Conn.Execute("Select Min(ID) From 产品 Where ID> "& varID & " and 类别='" & typeid & "'")
If Not Objrs.Bof Then MaxID=Objrs(0) Else MaxID=0 End If
If Not Objrs.Eof Then MinID=Objrs(0) Else MinID=0 End If