Here is a sample code:

Imports System.Data.OleDb
 
Public Class Form1
 
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
If (OpenFileDialog1.ShowDialog() <>
Windows.Forms.DialogResult.OK)
Then Return
Button1.Enabled = False
Dim udlfile [...]