.recordcount using vb.net and Acess2000

I am new to VB.net and was comfortable with VB6. I am in the process of updating existing applications and am using the below code to read a MS Access 2000 database:
            Dim dbConn2 As OleDbConnection
            Dim dbCommand2 As New OleDbCommand()
            Dim strPath As String

            glbTableName = "BatchAudit"
            glbString = "SELECT * FROM " & glbTableName & " WHERE PayorBatchID = " & Chr(34) & tmpID & Chr(34)
            strPath = glbBatchDatabaseName

            dbConn2 = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "DATA SOURCE=" & strPath)
            dbCommand2.CommandText = glbString
            dbCommand2.Connection = dbConn2
            Dim dbDR2 As OleDb.OleDbDataReader = dbCommand.ExecuteReader
            While dbDR2.Read
                tmpCleared = ToMonth(tmpAuditDate) & "/" & ToDay(tmpAuditDate) & "/" & ToYear(tmpAuditDate)
            End While


        Catch err As System.Exception
            glbErrorMessage = "ERROR: ReadNames - " & err.Message & vbCrLf
            glbErrorMessage = glbErrorMessage & "'" & glbString & "'"
            MsgBox(glbErrorMessage, MsgBoxStyle.Question, "- ERROR -")
        End Try

Using the above style how do I get a recordcount of the the records in a table.

Additionally, how can I read and edit a record simultaneously?
Who is Participating?
planoczConnect With a Mentor Commented:
Here is a link to a ADO app that is a good sample of what you need.


When you use a dataset you can find the count there. Kind of like the old vb6 recordset.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.