Solved

Updating Label showing Access Record

Posted on 2007-03-22
2
217 Views
Last Modified: 2010-04-23
vb.net 2003
access 2003

I have a lable on my from that I would like to see what record I'am on in this loop

LabelRec

Can I have the Label Updated as I loop through this access table records ?

Dim dbConnection As Data.OleDb.OleDbConnection
        Dim dbCommand As Data.OleDb.OleDbCommand
        Dim dbDataAdapter As Data.OleDb.OleDbDataAdapter
        Dim dbCommandBuilder As Data.OleDb.OleDbCommandBuilder
        Dim dbDataSet As Data.DataSet

        dbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DM2007\SkuCat.mdb;User Id=admin;Password=;")

        dbConnection.Open()
        dbCommand = New Data.OleDb.OleDbCommand("SELECT * FROM tblData", dbConnection)
        dbDataAdapter = New Data.OleDb.OleDbDataAdapter(dbCommand)
        dbCommandBuilder = New Data.OleDb.OleDbCommandBuilder(dbDataAdapter)
        dbDataSet = New Data.DataSet

        dbDataAdapter.Fill(dbDataSet, "tblData")

        With dbDataSet.Tables("tblData")
            For Each dbRow As Data.DataRow In dbDataSet.Tables("tblData").Rows
                ' regular function
  ' regex dot if not surrounded by Numerics  01172007
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                        "(?<1>[a-zA-Z])(?<2>\.)(?<3>\d)|(?<1>\d)(?<2>\.)(?<3>[a-zA-Z])", "$1 $3")

 '  regex Deleting Dot/periods if not surrounded by Numerics H.H  Y.C
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                   "([a-zA-Z])(\.)([a-zA-Z])", "$1 $3")

                ' regex slash if not surrounded by Numerics   G/G   Y/Y
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                   "([a-zA-Z])(\/)([a-zA-Z])", "$1 $3")
            Next
        End With

        dbDataAdapter.Update(dbDataSet, "tblData")

        dbConnection.Close()
       

Thanks fordraiders
0
Comment
Question by:fordraiders
[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
2 Comments
 
LVL 6

Accepted Solution

by:
kerryw60 earned 500 total points
ID: 18772350
Can I have the Label Updated as I loop through this access table records ?

Yes, but it will change so fast, you will not be able to see it as the code will move through the records too fast.  It will just look as though your label displays the last record.

myLabel.Text = myValue.ToString()

0
 
LVL 3

Author Comment

by:fordraiders
ID: 18775511
Thanks
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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