create odbc connection on the fly

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Martin

    create odbc connection on the fly

    Hi,

    I posted earlier about beeing able to find an SQL server database through
    code and someone was kind enough to help me out(thank you Scott). I now
    have another question;

    My app was written using odbc because of the need to install the program and
    use different databases depending on what the client has/owns. I now need
    to create an ODBC connection string during installation.

    This is the connection string generated by VS.NET 2003;

    "Trusted_Connec tion=Yes;DSN=Tr ansactionSQL;UI D=Administrator ;DATABASE=Trans a
    ctions;APP=Micr osoft® Visual Studio .NET;WSID=FLOAT ER99;Descriptio n=SQL
    Server Transaction DataBase"

    I'm trying to make sense of this string.
    Trusted connection = no password needed for this connection
    DSN = Needed because this is an ODBC connection
    UID = User ID
    Database = the actual name of the Database
    APP= the app using this connection
    WSID = Work station ID
    Description = The description I wrote when creationg the DSN

    My Question is about the DSN. Do I NEED it? What does this actualy contain?
    is it text? Can I create it during install(setup program)Where is it normaly
    located when created by VS.NET? Does MS have some kind of utility that can
    help me setup this connection?

    I thank you in advance for *any* input.

    Regards,

    Marco


  • hp

    #2
    RE: create odbc connection on the fly

    You can create dsn from ODBC manager - manually. In setup program you can create dsn using modifying registry or thru odbc apis. However, easiest way is to create dsnless connection.

    Comment

    • Marco Martin

      #3
      Re: create odbc connection on the fly

      Thanks HP,

      You were right, dsnless was the way to go. I found an example of it and it
      works beautifully.

      regards,

      Marco
      "hp" <anonymous@disc ussions.microso ft.com> wrote in message
      news:1013E7EE-5667-4CEB-BBCF-C4EAC406C3CA@mi crosoft.com...[color=blue]
      > You can create dsn from ODBC manager - manually. In setup program you can[/color]
      create dsn using modifying registry or thru odbc apis. However, easiest way
      is to create dsnless connection.


      Comment

      Working...