asp中用数据库生成不重复的流水号(2)
id = fornt & strBackFind & back
If strFind < strBackFind Then
Exit For
End If
If strFind > strBackFind Then
If i = idLen Then
id = id & "1"
Else
If Mid(id, idLen - i, 1) = AddOne(Mid(id, idLen - i, 1)) Then
id = fornt & strBackFind & back & "1"
Exit For
End If
End If
End If
Next
If id = tempid Then
id = id & "1"
End If
idAdd = id
End Function
'调用示例
serviceNO=getMaxOrder("serviceNO","service","serviceNO")
'其中保存所有字段流水号最大值的表的结构为:
表名:fieldMaxValue
字段
id fieldName fieldMaxValue