' ************************************************* ' 设置id字段的值,选择最大的id值加1后作为新的 id值 Dim id1 As Integer Dim str As String = " select max(id)+1 from shebei rd = d.readdata( str ) While rd.Read id1 = CInt (rd( 0 )) End While