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

    How to add an ODBC data source during setup?

    I use VB6 and MS Access. I want to add an ODBC data source during setup or the first time the program runs. I know I can do it manually by going to Start-Settings-COntrol Panel-ODBC Data Sources, but I want it achieved in programs. Does anybody know the API to do this in VB or InstallShield? Thank you very mcuh!


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to add an ODBC data source during setup?

    if you use a FILE DSN instead of a user or system DSN you won't need to use an API or access the Control panel.
    Simply create a FILE DSN on your development machine and include it in your setup.


  3. #3
    Join Date
    Oct 1999
    Posts
    6

    Re: How to add an ODBC data source during setup?

    Do you mean that setup will automatically add that DSN into ODBC Data Sources if that DSN does not exist in user's machine?


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: How to add an ODBC data source during setup?

    kind of.
    As far as FileDSNs are concerned, the control panel applet will look in a certain folder to see if there are any file DSNs (don't remember the exact folder path).
    Anyway, you can place yoUR FILEDSNFile anywhere you want, provided that you specify the path to that file DSN file in your connectionstring.


  5. #5
    Join Date
    Oct 1999
    Posts
    6

    Re: How to add an ODBC data source during setup?

    I looked Help and it says I can create a FILE DSN by right-click the database project I want to add a data connection to, and then select Add Data Connection. But I can not find it.

    My problem is that I need to tell Crystal Report a DSN which is in my development machine, but I want to make it appear in user's machine as well.


  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: How to add an ODBC data source during setup?

    Too bad, I don't really (want to) know much about Crystal Reports.
    You might want to take a look at the RegisterDatabase method in DAO. It allows you to programmatically create the DSN information.


  7. #7
    Join Date
    Oct 1999
    Posts
    6

    Re: How to add an ODBC data source during setup?

    Thank you very much! That is what I need!


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