Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 5 - Creating Data Link (UDL) Files in Delphi
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Creating Data Link (UDL) Files in Delphi
By: Danish Ahmed
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-08-06

    Table of Contents:
  • Creating Data Link (UDL) Files in Delphi
  • Section 1: Adding a new ODBC Data Source
  • Section 2: Connecting with SQL Server Drivers
  • Section 3: Creating Data Link files programmatically
  • Section 4: More undocumented routines in ADODB

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating Data Link (UDL) Files in Delphi - Section 4: More undocumented routines in ADODB


    (Page 5 of 5 )

    But that is not all, there a few more undocumented functions in the ADODB.pas unit which can help you avoid lengthy workarounds.

    Procedure GetProviderNames(Names: Tstrings);

    The GetProviderNames method can be used to fetch a list of all providers available.

    Memo1.Clear;
    GetProviderNames(Memo1.Lines);

    Procedure GetDataLinkFiles (Names: Tstrings);

    This function can be used to retrieve a list of filenames present in the DataLink folder (in my case the Data Link folder is in C:Program FilesCommon FilesSystemOle DB folder).

    Memo1.Clear;
    GetDataLinkFiles(Memo1.Lines);

    Function PromptDataSource(ParentHandle: THandle; InitialString: WideString): WideString;

    This function can be used to bring up the DataLink property dialog box and let the user provide the Data Source name. The PromptDataSource function returns the selected Data Source name as WideString.

    var
    ConxnStr:WideString;
    begin
     
    ConxnStr := PromptDataSource(Form1.Handle, ADOConnection1.ConnectionString);
      .....
    end;

    Function PromptDataLinkFile(ParentHandle: THandle; InitialFile: WideString): WideString;

    This function returns the file name and its path as a string. It can be employed to let the user select the datalink to be used for connection.

    var
    dlfStr:WideString;
    begin
     
    dlfStr:=PromptDataLinkFile(Form1.Handle,'');
     
    ....
    end;

    Play around a little with these undocumented routines contained in the ADODB.pas unit file and you will find out how easy it is to create and manage ADO connections in your Delphi application without hard-coding the connection string or writing long and complicated codes.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    DELPHI-KYLIX ARTICLES

    - 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...
    - Using the Client Dataset in Two-Tiered Clien...
    - Using the Client Dataset in File-Based Archi...
    - Demystifying the Client Dataset
    - Working with INI Files in Delphi
    - Creating Data Link (UDL) Files in Delphi
    - Looking at the Details for an Invoicing Appl...
    - Invoicing in Delphi: Show Me the Money
    - Saving Images and Binary Files to a Database...
    - Saving Files to a Database using Delphi: Sav...
    - Creating CF Applications and Integrating a S...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway