Solved

.recordcount using vb.net and Acess2000

Posted on 2007-03-31
1
291 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now