Solved

Updating Label showing Access Record

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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