Click here to Skip to main content
6,629,885 members and growing! (25,105 online)
Email Password   helpLost your password?
Web Development » ASP » Samples     Intermediate

DataLink Dialog from ASP

By Aj Horus

An ActiveX control that allows ASP users to display datalink dialogs.
VBScript, HTML, Windows, ASP, Visual Studio, Dev
Posted:24 Jan 2006
Views:14,843
Bookmarked:20 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
0 votes for this article

Sample Image

Introduction

This ActiveX control allows the user to build a connection string from the data providers listed on a client machine. The ActiveX invokes the standard DataLink dialog that lists all the data providers and the parameters needed for a valid connection string. This dialog also tests the connection.

Using the code

  • dl: the ActiveX object that displays the DataLink dialog.
  • OpenDl: Opens the DataLink dialog.
  • connectin: string returned by the DataLink dialog.

VBScript is used for calling the ActiveX control methods.

  <HEAD>
    <title>Test Datalink Dialog from .Net</title>
  <meta content="Microsoft Visual Studio .NET 7.1" 
                                     name="GENERATOR">
  <meta content="C#" name="CODE_LANGUAGE">
  <meta content="JavaScript" name="vs_defaultClientScript">
  <meta content="http://schemas.microsoft.com/intellisense/ie5" 
                                          name="vs_targetSchema">
    
  <script language="vbscript">
    Sub cmdChange_Click        
      dl.openDl 
      document.forms(0).txtConnectionString.Value = _
                                     dl.connectin
    End Sub
  </script>
  </HEAD>
  <body MS_POSITIONING="GridLayout">
    <OBJECT id="dl" codeBase="dl.CAB#version=1,0,0,0" 
      height="0" width="0" 
      classid="CLSID:ED467200-646D-46ED-992A-418EC94C319F"
    VIEWASTEXT>
    <PARAM NAME="_ExtentX" VALUE="26">
    <PARAM NAME="_ExtentY" VALUE="26">
  </OBJECT>
  <form id="Form1" method="post" runat="server">
    <asp:TextBox id="txtConnectionString" 
    style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 64px"
    runat="server"></asp:TextBox>
    <INPUT TYPE="button" id="dlName2" 
    NAME="dlName2" VALUE="test" OnClick="cmdChange_Click"
    style="Z-INDEX: 102; LEFT: 176px; POSITION: absolute; TOP: 64px">
    <asp:Label id="Label1" 
    style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 32px" 
    runat="server" Width="344px" 
    Font-Size="Larger">Datalink Dialog</asp:Label>
  </form>
  </body>
</HTML>

Points of Interest

ActiveX is a complete new world for me. I am a hardcore .NET programmer. I used to dislike VB 6, but I have to admit, it is great for creating ActiveX controls. They provide full system access. A little risky if run over the Internet, but in specific environments (like intranets) they could be quite useful.

History

So far this is the first version, it was made for a specific client need. There are tons of improvements that can be made, however I don't have the time right now.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Aj Horus


Member

Occupation: Web Developer
Location: Panama Panama

Other popular ASP articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 24 Jan 2006
Editor: Smitha Vijayan
Copyright 2006 by Aj Horus
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project