Dim conn Set conn = CreateObject("ADODB.Connection") conn.Open "File Name=C:\MyConnection.udl"
Function GetNewConnection(ByVal UdlFile) Set GetNewConnection = CreateObject("ADODB.Connection") GetNewConnection.Open "File Name=" & UdlFileEnd Function
Set rs = GetNewConnection("C:\MyConnection.udl").Execute("select * from sometable")While Not rs.EOF '...Wend