It's a lot simpler, if you want to avoid duplicating a name, to open a recordset "... Where table.UserName = '" & TheNameYouDon'tWantToDuplicate & "'" Then if EOF there's no record with that name - there's no need to loop through the recordset looking for it.

(Name is a reserved word in almost every database, so don't use it as a field name.)

As far as the cancel button in the UDL dialog goes (it doesn't throw an error):
Code:
Dim conn As ADODB.Connection
'...
  Set conn = dl.PromptNew
  If conn Is Nothing Then
    MsgBox "cancelled"
  Else
    MsgBox "not cancelled"
  End If
@Si:
A UDL file is a cheap and easy way to create the connection string. Open it (as a UDL file - double-click on it), fill out the information it needs, close it, open it in Notepad and copy the connection string.