CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Posts
    9

    Configuring File DSN

    How to invoke configure dialog for a File DSN from C program? I can do it for System/user DSN using SQLConfigDataSource.

    Thanks in advance,
    Manoj

  2. #2
    Join Date
    Apr 2009
    Location
    Cochin
    Posts
    83

    Resolved Re: Configuring File DSN

    Quote Originally Posted by manojmarathayil View Post
    How to invoke configure dialog for a File DSN from C program? I can do it for System/user DSN using SQLConfigDataSource.

    Thanks in advance,
    Manoj
    Yes, You can create either System DSN or User DSN using the API SQLConfigDataSource().

    User or system data sources can be created by an ODBC application that calls the SQLConfigDataSource function with the fRequest parameter set to either ODBC_ADD_DSN or ODBC_ADD_SYS_DSN.

    I cannot understand why you're looking to invoke the DSN COnfiguration wizard window through a program.

    You can easily do it via Windows API's.

    The program for DSN Config wizard dialog is "odbcad32.exe" located in the "WINDOWS\System32" folder. You can try programatically executing the pogram.

    Hopes this helps
    "I studied everything but never topped. Today, toppers of the world's best universities are my employees"

    -William Henry Gates (Bill Gates)

  3. #3
    Join Date
    Jan 2008
    Posts
    9

    Re: Configuring File DSN

    Thanks for your time.
    Using SQLConfigDataSource I can modify a system/user DSN also, similarly I want to modify a "FILE DSN", i don't wan to invoke the Manage DSN dialog, i just want to invoke the modify configuration dialog for a "FILE DSN".

  4. #4
    Join Date
    Apr 2009
    Location
    Cochin
    Posts
    83

    Smile Re: Configuring File DSN

    Here is an Article in the Microsoft Knowledgebase, you may check out that :

    http://support.microsoft.com/kb/q165866/

    It describes pretty welll about DSN Less connections and FILE DSN connections.
    "I studied everything but never topped. Today, toppers of the world's best universities are my employees"

    -William Henry Gates (Bill Gates)

  5. #5
    Join Date
    Jan 2008
    Posts
    9

    Re: Configuring File DSN

    Hi, thanks for your reply.
    I think you misunderstood my requirement. I can create a FILE DSN there is no problem, the requirement is how can I popup the configure FILE DSN dialog just like when we modify a System/User DSN using SQLConfigDataSource with a valid handle as the first parameter. Using this dialog we can configure the data format using "Define format...", which will in turn create a schema.ini in the data folder(I am talking about microsoftt text/csv driver.

  6. #6
    Join Date
    Apr 2009
    Location
    Cochin
    Posts
    83

    Smile Re: Configuring File DSN

    Quote Originally Posted by manojmarathayil View Post
    Hi, thanks for your reply.
    I think you misunderstood my requirement. I can create a FILE DSN there is no problem, the requirement is how can I popup the configure FILE DSN dialog just like when we modify a System/User DSN using SQLConfigDataSource with a valid handle as the first parameter. Using this dialog we can configure the data format using "Define format...", which will in turn create a schema.ini in the data folder(I am talking about microsoftt text/csv driver.
    if you really want to popup the Configure File DSN Dialog, whats the problem in invoking "odbcad32.exe" in the system32 folder??

    The same dialogbox provides tabs for System DSN, User DSN, File DSN, Drivers etc.. etc...

    You need to programatically ShellExecute() the "odbcad32.exe" to popup the dialog. File DSN config is in the 3rd Tab.
    "I studied everything but never topped. Today, toppers of the world's best universities are my employees"

    -William Henry Gates (Bill Gates)

  7. #7
    Join Date
    Jan 2008
    Posts
    9

    Angry Re: Configuring File DSN

    How can you create a software there users need to think? here if I am showing Manage DSN dialog then user need to navigate to FILE DSN tab and he need to identify the file? why introducing these complexity to the user?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured