Public Function fnGetNextMaxNo(ByVal strFieldName As String) As Integer
fnGetNextMaxNo = 0
Dim adoRs As VbToRecordSet
Dim strSql As String = ""
Try
fnGetNextMaxNo = 1
strSql = "select max(" + strFieldName + ") from " + strTableName
mstrLastExecutedSql = strSql
adoRs.Open(strSql, adoconDb)
If Not adoRs.EOF Then
If Not IsDBNull(adoRs.Fields(0).Value) Then
fnGetNextMaxNo = Convert.toDouble(adoRs.Fields(0).Value) + 1
End If
End If
adoRs.Close()
Exit Function
我正在尝试将vb6转换为vb.net,上面的代码第一行显示错误,该语句在名称空间中无效...请帮帮我
答案 0 :(得分:0)
只需替换
Dim adoRs As VbToRecordSet
带
Dim adoRs As adodb.RecordSet