Solved

Updating Label showing Access Record

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

861 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

23 Experts available now in Live!

Get 1:1 Help Now