BLACK FRIDAY Sale with 50% off starts in: 
Is there an easy way to create a DSN-less connection to a database?
March 21, 2002 by Marcellino Bommezijn

Steps to Create a DSN-Less Connection String for your Access and SQL Server database(s) using some nice windows features.

  1. Right-Click the desktop.
  2. Select New
  3. Select New Text File
  4. Give it a unique name
  5. Change the extension to "UDL" (Stands for Universal Data Link)
  6. Double-Click the file
  7. Walk through the wizard and test the connection.
  8. Click Finish to Save it to the file.
  9. Open the file in notepad.
  10. Copy the string that is written after the line 'Everything after this line is... etc'. This is your dsn-less connection to be used in your connection settings!

For Access databases you will need to remove the part of the physical drive location with where your database resides on our web server:

You have uploaded a database named "test.mdb" to a folder that hangs off the root of your account named "Database".

So you need to replace the file path with:

Marcellino Bommezijn

Marcellino BommezijnMarcellino Bommezijn is one of the managers at He is a contributor on the tutorials section.

Owner of Senzes Media ( which provides professional services and web applications for mid-sized companies.

ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.

See All Postings From Marcellino Bommezijn >>

Place your comment about Is there an easy way to create a DSN-less connection to a database?

You must me logged in to write a comment
DSN-Less Connection to Access
June 8, 2002 by Peter Kumaschow

I tried under XP and also got the problem with the spaces. It also created a standard Microsoft Access connection. If you are using Access 2000 you will get better performace using a Jet 4.0 connection string like so:

myDSN=myDSN & "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(accessdb) & ";"
Dim oConn
Set oconn="server".createobject("adodb.connection") myDSN
If Err.Number = 0  Then
Your code goes here
Else 'Database connection failed so show a message
Response.Write "Database unavailable" & "<br>"
Response.Write "Err Number: " & Err.Number & "<br>"
Response.Write "Description: " & Err.Description & "<br>"
End If
set oConn = nothing


A Very Useful FAQ..Thanks!!
April 29, 2002 by Ivan Flack

Great FAQ..but the issue of spaces occurs with me also.

A minor niggle

March 26, 2002 by Bill Chalmers
On every machine I have tried this on, the resultant string when opened in notepad comes with spaces inbetween each letter, its not a huge point but is there any way to get rid of the spaces??