Generate Connection String (keluarga Microsoft)

Kebiasaan menggunakan VB 6.0 jadi dimanjain saat membuat connection string menggunakan ADODC, agak ga terbiasa ketika menggunakan VB .Net dan CSharp. Meskipun sebenernya ada caranya tetep aja jadi kaku.
Sampe akhirnya gw menemuka cara yaitu menggunakan bantuan Universal Data Link (.udl) Files.

Untuk tahapan pembuatan gw ambil dari http://msdn.microsoft.com, seperti berikut :

Creating and Configuring Universal Data Link (.udl) Files

The Microsoft Data Access Components (MDAC) provide the Data Link Properties dialog box as the common user interface for specifying connection information to a data provider on Windows 2000 and later operating systems. You can use the Data Link Properties dialog box to save connection information in a universal data link (.udl) file.

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. 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.

    If you are running Windows 98 and Windows NT systems with Microsoft Data Access Components (MDAC) installed, right-click the right pane, or results pane, select New, and choose Microsoft Data Link. A new file named New Microsoft Data Link.udl appears in the directory. You can rename this file.

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 a database provider.
  3. On the Connection tab, either select the data source name (DSN) of an available Provider, or enter a custom connection string. Valid DSNs for providers that are pre-defined on your system are displayed in the Use Data Source drop-down list.
  4. Use the Advanced tab to view and set other initialization properties for your data.
  5. Use the All tab to review and edit all OLE DB initialization properties available for your OLE DB provider.
  6. Choose OK to save the connection string to the Universal Data Link (.udl) file.

Kl koneksi dah berhasil dibuat, buka file .udl yang tercipta dengan text editor seperti notepad, notepad++ dll.
Ambil dah bagian connection 🙂

One thought on “Generate Connection String (keluarga Microsoft)

Leave a Reply

Your email address will not be published. Required fields are marked *