Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4125460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:52:20+00:00 2026-05-20T23:52:20+00:00

I want to create ODBC DSN for a database (which will be included in

  • 0

I want to create ODBC DSN for a database (which will be included in my application folder whenever a user setups the application). I want to know how to create ODBC with all the required parameters so that the first thing that is done when the setup is being run is connecting the database to the application. I have tried using default VB.NET setup wizard and Installshield.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:52:21+00:00Added an answer on May 20, 2026 at 11:52 pm

    I don’t know any method to create DSN via installer or with VB.NET but using Windows utilities you can create one.

    this page shows how to create DSN in Windows using command line utility odbcconf so once you create a batch script that can create DSN according to your application requirements, you can trigger the batch to get executed before your setup copies files to the users computer. So after the script is executed, application installation will move further to copy remaining files and after installation completes, and application starts, your connection to the DSN will work as expected, since DSN is now created. I haven’t worked with InstallShield though, my experience with NSIS says that executing batch script via installer will surely bring up the command prompt window during installation, which you might not want.

    Another way to avoid showing command prompt window is to execute your batch script (in silent mode) upon first run of your application, before it establishes any connection to database. You can execute your batch file (.bat) without showing command prompt window using WScript.Shell object as follows.

    Dim batfile As String
    
    batfile = "C:\Program Files\Your App\YouDSNCreationBatchFile.bat"
    
    Set WshShell = CreateObject("WScript.Shell")
    
    cmds = WshShell.RUN("""" & batfile & """", 0, True) 'All Quotes are necessary if file path contains folders with spaces in thier names
    
    Set WshShell = Nothing
    

    Though odbcconf can also be used in VB directly to create DSN, but if you don’t want to tweak your application code to create DSN before it connects, using batch script will be a fail-safe solution, however, as I guess, you might have connected your application in try block, so if you catch exception which thrown due to lack of availability of DSN it required, this batch script can be called again to create one or prompt user for the same.

    !!IMPORTANT: As MSDN page says, odbcconf utility is likely to be removed from future versions of Windows Data Access Components, you should reconsider this method if you are using this for long-term.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a Java application bundle for Mac without using Mac. According
I want to create a client side mail creator web page. I know the
I want to create an allocator which provides memory with the following attributes: cannot
I want to create my Rails application with MySQL, because I like it so
I want to create an installer for my java desktop application, instead of Advanced
I want create a pdf using iText. The method which does this is a
I want create a generic (general) method which accepts the return types of LINQ
I want to create a login system with a MS Access database. the data
what are the various other programs using which i can connect to odbc database
I want create a DataSet class which is basically a list of samples. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.