Solved

Updating Label showing Access Record

Posted on 2007-03-22
2
211 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
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

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

12 Experts available now in Live!

Get 1:1 Help Now