To create a Universal Data Link (.udl) file
1. Open Windows Explorer.
2. Select the folder in which you want to store the .udl file.
3. If you are running Windows 2000 or later, select New on the File menu, and choose Text Document.
4. A new file named New Text Document.txt appears in the directory. Rename this file, removing all spaces and changing its file extension to .udl.
Note A warning that changing file extensions can cause files to become unusable might appear. Disregard it.
To configure a universal data link (.udl) file
1. Double-click the universal data link (.udl) file. The Data Link Properties dialog box opens, displaying the following tabs: Provider, Connection, Advanced, and All. Choose Next to navigate from tab to tab.
2. On the Provider tab, select PostgreSQL Native Provider.
3. On the Connection tab, enter the Data Source name, User name, Password, and Initial catalog.
4. Use the Advanced tab to view and set other initialization properties for your database.
5. Use the All tab to review and edit all OLE DB initialization properties available for PGNP.
6. Choose OK to save the connection string to the Universal Data Link (.udl) file.
Data Link File Format
The first two lines of a universal data link (.udl) file must have exactly this content:
- Code: Select all
[oledb]
; Everything after this line is an OLE DB initstring
After these required lines, the remainder of the .udl file consists of a connection string written in the same format used when opening a database from programming code. The following listing gives the complete text of a .udl file that uses the PGNP OLEDB provider for PostgreSQL to open the postgres database using User name postgres and Password 12345.
- Code: Select all
[oledb]
; Everything after this line is an OLE DB initstring
Provider=PGNP.1;Password=12345;Persist Security Info=True;User ID=postgres;Initial Catalog=postgres;Data Source=localhost;Extended Properties=""
