Pages

Total Pageviews

Add This

Friday, May 13, 2011

Populate Listview

If you use Microsoft Access 2003 as a database, Microsoft.ACE.OLEDB.12.0 as a Provider and Listview as a Form control, to populate the Listview after the connecting then you can use the function bellow:


Public Sub Connect_database()
        Try
            With connection
                If .State = ConnectionState.Open Then .Close()
                .ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Contacts.mdb"
                .Open()
            End With
        Catch ex As Exception
            MessageBox.Show("Not connected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        End Try
End Sub

4 comments:

  1. Bravo Angelco. I now see new things on yout web site. I am glad it is not one f those web sites where you forget to change and update things. Excellent job.

    ReplyDelete
  2. Hi there to every single one, it's actually a pleasant for me to pay a visit this web page, it contains priceless Information.
    Here is my page laser tattoo removal

    ReplyDelete
  3. If some one desires to be updated with most up-to-date technologies therefore he must be visit this site and be up to date everyday.
    Also visit my blog :: skin whitening pills

    ReplyDelete
  4. Hi, I do think this is a great blog. I stumbledupon it ;)
    I will return yet again since i have book marked it.
    Money and freedom is the greatest way to change, may you be rich
    and continue to guide other people.
    Check out my homepage :: acne remedy

    ReplyDelete