database path to be added in the coding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raghulvarma
    New Member
    • Oct 2007
    • 90

    database path to be added in the coding

    I am using MS Access and vb.net, Now I have included ms access into the application.whe n I did my coding I did by

    Code:
    cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;_
      PersistSecurityInfo=False")
    but when I need to deploy it in client system I cant know in which drive they are going to put that? so how could I change it?

    Thanks in advance
    Raghul
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by raghulvarma
    I am using MS Access and vb.net, Now I have included ms access into the application.whe n I did my coding I did by

    Code:
    cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;_
      PersistSecurityInfo=False")
    but when I need to deploy it in client system I cant know in which drive they are going to put that? so how could I change it?

    Thanks in advance
    Raghul
    Your access database resides in C:\ drive so you should deploy it also in that directory.

    If you to make it more dynamic, see this related article


    Rey Sean

    Comment

    • truezplaya
      New Member
      • Jul 2007
      • 115

      #3
      You could look in to putting the connection info into an xml file. This will allow you to specify a genral path. So when the program is installed you just put the XML file in to the location you stated within your program.

      This also helps if the location of the DB changes or the name.

      Comment

      Working...