Selecting Database Path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony K

    #1

    Selecting Database Path

    Hi all,
    I have an inventory application I'm writing for the company I work for
    and realized the path for the Access database might reside on a network
    drive. I have used Microsoft's Add Data Source method of adding the db to
    the app. How could I customize this so the path can be changed. I found
    that the connection is a ReadOnly property and cannot be changed.

    Thanks,

    Tony K

  • Chris

    #2
    Re: Selecting Database Path

    I'm assuming that you're using VB.NET for your application.

    When you run the add data source wizard in VS2005, it will create an
    application variable called "ConnectionStri ng" in your applications's config
    file ("MyInventoryAp p.exe.config", for example). That can be changed by any
    text editor.

    Were you wanting the user to be able to change it via the user interface?

    "Tony K" <notmyfirstname @kingprogrammin g.comwrote in message
    news:uu9ag9YzHH A.536@TK2MSFTNG P06.phx.gbl...
    Hi all,
    I have an inventory application I'm writing for the company I work for
    and realized the path for the Access database might reside on a network
    drive. I have used Microsoft's Add Data Source method of adding the db to
    the app. How could I customize this so the path can be changed. I found
    that the connection is a ReadOnly property and cannot be changed.
    >
    Thanks,
    >
    Tony K

    Comment

    • Tony K

      #3
      Re: Selecting Database Path

      Yes, I was hoping to be able to program say a "Tools" form and allow the
      user to select where the database resides then write that info to a config
      file or store that path in the registry or something like that.

      Tony K


      "Chris" <chrisandkam@sb cgloal.netwrote in message
      news:SMdpi.2984 6$C96.22393@new ssvr23.news.pro digy.net...
      I'm assuming that you're using VB.NET for your application.
      >
      When you run the add data source wizard in VS2005, it will create an
      application variable called "ConnectionStri ng" in your applications's
      config file ("MyInventoryAp p.exe.config", for example). That can be
      changed by any text editor.
      >
      Were you wanting the user to be able to change it via the user interface?
      >
      "Tony K" <notmyfirstname @kingprogrammin g.comwrote in message
      news:uu9ag9YzHH A.536@TK2MSFTNG P06.phx.gbl...
      >Hi all,
      > I have an inventory application I'm writing for the company I work for
      >and realized the path for the Access database might reside on a network
      >drive. I have used Microsoft's Add Data Source method of adding the db
      >to the app. How could I customize this so the path can be changed. I
      >found that the connection is a ReadOnly property and cannot be changed.
      >>
      >Thanks,
      >>
      >Tony K
      >
      >

      Comment

      • Tony K

        #4
        Re: Selecting Database Path

        Chris,
        How would I access the config file? The filename is
        Inventory.exe.c onfig and the info that I would need to access is:

        <connectionStri ngs>
        <add
        name="Daily_Foo ds_Inventory.My .MySettings.Inv entory_manageme nt_databaseConn ectionString"
        connectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0;Data
        Source=&quot;|D ataDirectory|\I nventory management database.mdb&qu ot;"
        providerName="S ystem.Data.OleD b" />
        </connectionStrin gs>

        Tony K
        "Chris" <chrisandkam@sb cgloal.netwrote in message
        news:SMdpi.2984 6$C96.22393@new ssvr23.news.pro digy.net...
        I'm assuming that you're using VB.NET for your application.
        >
        When you run the add data source wizard in VS2005, it will create an
        application variable called "ConnectionStri ng" in your applications's
        config file ("MyInventoryAp p.exe.config", for example). That can be
        changed by any text editor.
        >
        Were you wanting the user to be able to change it via the user interface?
        >
        "Tony K" <notmyfirstname @kingprogrammin g.comwrote in message
        news:uu9ag9YzHH A.536@TK2MSFTNG P06.phx.gbl...
        >Hi all,
        > I have an inventory application I'm writing for the company I work for
        >and realized the path for the Access database might reside on a network
        >drive. I have used Microsoft's Add Data Source method of adding the db
        >to the app. How could I customize this so the path can be changed. I
        >found that the connection is a ReadOnly property and cannot be changed.
        >>
        >Thanks,
        >>
        >Tony K
        >
        >

        Comment

        Working...