Home arrow Delphi-Kylix arrow Page 2 - Creating Data Link (UDL) Files in Delphi

Creating Data Link (UDL) Files in Delphi

The connection string required to connect to a database server may be created during design time or run time. There are circumstances under which you may want to store the connection string entirely outside the application, however. In those instances, Microsoft Data Link files are useful, as this article will explain.

Author Info:
By: Danish Ahmed
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
August 06, 2007
  1. · Creating Data Link (UDL) Files in Delphi
  2. · Section 1: Adding a new ODBC Data Source
  3. · Section 2: Connecting with SQL Server Drivers
  4. · Section 3: Creating Data Link files programmatically
  5. · Section 4: More undocumented routines in ADODB

print this article

Creating Data Link (UDL) Files in Delphi - Section 1: Adding a new ODBC Data Source
(Page 2 of 5 )


Go to control panel|Administrative Tools and click on the Data Source (ODBC) icon. This should bring up a multi-tabbed dialog box. Click on the Add button and you are presented with a list of available drivers. Select the appropriate driver (which in my case is MS SQL Driver) and click Finish. Another dialog is displayed; enter the data source name and description which you will later use to connect to the data source.

The drop-down box lists the available database servers on the network; select the appropriate server name and click Next. The next step requires you to specify how the server should authenticate the login, OS authentication or SQL Server authentication with the credentials provided by the user. If it's the latter then you need to make sure you have entered the correct username and password. Click next, and from the drop-down box select "testdb" as the default database.

The last page contains language, encryption, regional settings and logging options which are pretty much obvious. After clicking finish you are presented with a message window listing the configuration. Click on "Test connection" to make sure that the Data Source was created successfully. If the result is affirmative you have successfully created the DSN and can now use it to connect to the database from your Delphi program.

Now let us get back to the .udl file. Double-click on it to bring up the Data Link Property dialog box if it is not already visible. Make sure the Connection tab has focus. The ODBC DSN you created should now be available in the drop-down box (click refresh if it is not available). Select the DSN, enter the user name and password and check "allow saving password." Next select the initial catalog to use from the list available in the drop-down box. Click test connection to verify that the connection was successful.

blog comments powered by Disqus

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials