Solved

.recordcount using vb.net and Acess2000

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

734 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