Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.recordcount using vb.net and Acess2000

Posted on 2007-03-31
1
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

by:
planocz earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
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…
Suggested Courses

715 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