Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MSDASC.DataLinks PromptNew()

MSDASC.DataLinks PromptNew()

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    inyoursadachine
    wrote on last edited by
    #1

    Hi, How do I create the IDataSourceLocator (hWnd) for my MSDASC.DataLinks object without first calling the PromptNew() method plus DialogResult.OK ?? I have a program where I want the user to be able to edit a connection string known (loaded) when the program starts. I want to be able to do something like this: private ADODB._Connection m_AdoDbConn; // then, create m_AdoDbConn without calling PromptNew() so I can do.. m_AdoDbConn.ConnectionString = sConnStrLoadedFromDisk; object o = (object) m_AdoDbConn; MSDASC.DataLinks oDlg = new MSDASC.DataLinksClass(); oDlg.PromptEdit(ref o); --------------- TIA, Matt

    H 1 Reply Last reply
    0
    • I inyoursadachine

      Hi, How do I create the IDataSourceLocator (hWnd) for my MSDASC.DataLinks object without first calling the PromptNew() method plus DialogResult.OK ?? I have a program where I want the user to be able to edit a connection string known (loaded) when the program starts. I want to be able to do something like this: private ADODB._Connection m_AdoDbConn; // then, create m_AdoDbConn without calling PromptNew() so I can do.. m_AdoDbConn.ConnectionString = sConnStrLoadedFromDisk; object o = (object) m_AdoDbConn; MSDASC.DataLinks oDlg = new MSDASC.DataLinksClass(); oDlg.PromptEdit(ref o); --------------- TIA, Matt

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      All you need is a valid connection string. I created an RCW from the MSDASC typelib and imported the PIA for ADODB (ADODB.dll). My sample code below worked fine (except that I changed the computer name in the ConnectionString):

      using System;
      using ADODB;
      using MSDASC;

      public class EditDSN
      {
      static void Main()
      {
      ConnectionClass conn = new ConnectionClass();
      conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;"
      + "Data Source=MACHINE;Initial Catalog=master";

      object o = conn;
      DataLinksClass links = new DataLinksClass();
      links.PromptEdit(ref o);
      

      }
      }

      Microsoft MVP, Visual C# My Articles

      I 1 Reply Last reply
      0
      • H Heath Stewart

        All you need is a valid connection string. I created an RCW from the MSDASC typelib and imported the PIA for ADODB (ADODB.dll). My sample code below worked fine (except that I changed the computer name in the ConnectionString):

        using System;
        using ADODB;
        using MSDASC;

        public class EditDSN
        {
        static void Main()
        {
        ConnectionClass conn = new ConnectionClass();
        conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;"
        + "Data Source=MACHINE;Initial Catalog=master";

        object o = conn;
        DataLinksClass links = new DataLinksClass();
        links.PromptEdit(ref o);
        

        }
        }

        Microsoft MVP, Visual C# My Articles

        I Offline
        I Offline
        inyoursadachine
        wrote on last edited by
        #3

        Heath, You are the man! Thank You.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups