Solved

.recordcount using vb.net and Acess2000

Posted on 2007-03-31
1
323 Views
Last Modified: 2013-12-25
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:
        Try
            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
            dbConn2.Open()
            Dim dbDR2 As OleDb.OleDbDataReader = dbCommand.ExecuteReader
            While dbDR2.Read
                tmpCleared = ToMonth(tmpAuditDate) & "/" & ToDay(tmpAuditDate) & "/" & ToYear(tmpAuditDate)
            End While

            dbConn2.Close()

        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?
0
Comment
Question by:MyLifeServices
1 Comment
 
LVL 27

Accepted Solution

by:
planocz earned 500 total points
ID: 18830921
Here is a link to a ADO app that is a good sample of what you need.

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21909295.html

When you use a dataset you can find the count there. Kind of like the old vb6 recordset.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question