connection string variable...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brad Pears

    #1

    connection string variable...

    We have several applications that use the ".exe.confi g" .xml file to get
    the connection string to our SQL server db. Each user of the application has
    their own .xml file because we have some user specific settings in there...

    My question is this... We are looking at setting up a backup SQL server. I
    would like to modify the .xml config files so that they read the connection
    string from a network share instead. That way, we can easily change the
    server name in place so that the next time the users run the app, it will be
    pointing to the backup server and vice versa.

    Does anyone have any ideas how this could be done?

    Thanks, Brad


  • Mr. Arnold

    #2
    Re: connection string variable...


    "Brad Pears" <bradp@truenort hloghomes.comwr ote in message
    news:ewNN1ptoHH A.4212@TK2MSFTN GP04.phx.gbl...
    We have several applications that use the ".exe.confi g" .xml file to get
    the connection string to our SQL server db. Each user of the application
    has their own .xml file because we have some user specific settings in
    there...
    >
    My question is this... We are looking at setting up a backup SQL server.
    I would like to modify the .xml config files so that they read the
    connection string from a network share instead. That way, we can easily
    change the server name in place so that the next time the users run the
    app, it will be pointing to the backup server and vice versa.
    >
    Does anyone have any ideas how this could be done?
    You come-up with a file called connstr.txt and have the connection string in
    that file, after all it's just string/text data in a file, whether it's in
    an XML file or a non XML text file type.

    You create a function that opens that file and reads the string data from
    connstr.txt. You can have a path statement in the ".exe.confi g" .xml
    pointing to connstr.txt. Connstr.txt can be out there on a network share.
    You're only problem would be if two or more users tried to open Connstr.txt
    at the same time.

    You may need some code in the function to try again to open the file on some
    iteration count, before it indicates it can't open the file. But that's most
    likely not going to happen anyway with multiple users trying to open the
    file at the same time.

    Comment

    • Brad Pears

      #3
      Re: connection string variable...

      So would you write the function separate from the app using vb script (a
      ..vbs file) and somehow call that from the .xml file (if you can) or would
      you code this directly into the application - where we are getting the
      config settings now? and just string together the server name with the rest
      of the connection string?

      Thanks, Brad

      "Mr. Arnold" <MR. Arnold@Arnold.c omwrote in message
      news:uWlBe%23uo HHA.5052@TK2MSF TNGP04.phx.gbl. ..
      >
      "Brad Pears" <bradp@truenort hloghomes.comwr ote in message
      news:ewNN1ptoHH A.4212@TK2MSFTN GP04.phx.gbl...
      >We have several applications that use the ".exe.confi g" .xml file to get
      >the connection string to our SQL server db. Each user of the application
      >has their own .xml file because we have some user specific settings in
      >there...
      >>
      >My question is this... We are looking at setting up a backup SQL server.
      >I would like to modify the .xml config files so that they read the
      >connection string from a network share instead. That way, we can easily
      >change the server name in place so that the next time the users run the
      >app, it will be pointing to the backup server and vice versa.
      >>
      >Does anyone have any ideas how this could be done?
      >
      You come-up with a file called connstr.txt and have the connection string
      in that file, after all it's just string/text data in a file, whether it's
      in an XML file or a non XML text file type.
      >
      You create a function that opens that file and reads the string data from
      connstr.txt. You can have a path statement in the ".exe.confi g" .xml
      pointing to connstr.txt. Connstr.txt can be out there on a network share.
      You're only problem would be if two or more users tried to open
      Connstr.txt at the same time.
      >
      You may need some code in the function to try again to open the file on
      some iteration count, before it indicates it can't open the file. But
      that's most likely not going to happen anyway with multiple users trying
      to open the file at the same time.

      Comment

      Working...