my.settings and the connectionstring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andre Rode

    #1

    my.settings and the connectionstring

    Hi, a question

    I use a mdb database for my application. The application should be able
    to handle more than one mdb, so I think I have to change
    my.settings.Con String (this is my connectionstrin g) Like this
    Provider=Micros oft.Jet.OLEDB.4 .0;Data Source=c:\DAT.m db;Persist Security
    Info=True;Passw ord=password;Us er ID=user;Jet OLEDB:System
    database=c:\sec urity.mdw;Jet OLEDB:Database Password=passwo rd

    The only thing I want to change is the data source element...

    But this setting is read only and the scope cannot be set to "User"

    Or am I on the wrong way?

    Greetings from Germany
    Andre
  • tommaso.gastaldi@uniroma1.it

    #2
    Re: my.settings and the connectionstrin g

    Hi Andre,

    you need to setup a string variable and concatenate it in the
    connection string.
    Here is an example from a connection of mine:

    Me.ConnectionSt ring = _
    "Provider=Micro soft.Jet.OLEDB. 4.0" & _
    ";Data Source=" &
    Me.Informazioni FileDatabase.No meFile & _
    ";User ID=" & UserId & _
    ";Jet OLEDB:Database Password=" & Password & _
    ";Mode=Shar e Deny None"

    the database property is just for information, once you have connected.

    -tom

    Andre Rode ha scritto:
    [color=blue]
    > Hi, a question
    >
    > I use a mdb database for my application. The application should be able
    > to handle more than one mdb, so I think I have to change
    > my.settings.Con String (this is my connectionstrin g) Like this
    > Provider=Micros oft.Jet.OLEDB.4 .0;Data Source=c:\DAT.m db;Persist Security
    > Info=True;Passw ord=password;Us er ID=user;Jet OLEDB:System
    > database=c:\sec urity.mdw;Jet OLEDB:Database Password=passwo rd
    >
    > The only thing I want to change is the data source element...
    >
    > But this setting is read only and the scope cannot be set to "User"
    >
    > Or am I on the wrong way?
    >
    > Greetings from Germany
    > Andre[/color]

    Comment

    • Andre Rode

      #3
      Re: my.settings and the connectionstrin g

      tommaso.gastald i@uniroma1.it schrieb:[color=blue]
      > Hi Andre,
      >
      > you need to setup a string variable and concatenate it in the
      > connection string.
      > Here is an example from a connection of mine:
      >
      > Me.ConnectionSt ring = _
      > "Provider=Micro soft.Jet.OLEDB. 4.0" & _
      > ";Data Source=" &
      > Me.Informazioni FileDatabase.No meFile & _
      > ";User ID=" & UserId & _
      > ";Jet OLEDB:Database Password=" & Password & _
      > ";Mode=Shar e Deny None"
      >
      > the database property is just for information, once you have connected.
      >
      > -tom
      >
      > Andre Rode ha scritto:
      >[color=green]
      >> Hi, a question
      >>
      >> I use a mdb database for my application. The application should be able
      >> to handle more than one mdb, so I think I have to change
      >> my.settings.Con String (this is my connectionstrin g) Like this
      >> Provider=Micros oft.Jet.OLEDB.4 .0;Data Source=c:\DAT.m db;Persist Security
      >> Info=True;Passw ord=password;Us er ID=user;Jet OLEDB:System
      >> database=c:\sec urity.mdw;Jet OLEDB:Database Password=passwo rd
      >>
      >> The only thing I want to change is the data source element...
      >>
      >> But this setting is read only and the scope cannot be set to "User"
      >>
      >> Or am I on the wrong way?
      >>
      >> Greetings from Germany
      >> Andre[/color]
      >[/color]
      Okay, seems to be another way.
      But I use the connectionStrin g defined in the settings for binding data
      to my datagridviews. How will this work?

      Should the ConnectionStrin g be a global variable?

      Sorry for the stupid questions, I'm new to ADO.NET, I've worked with DAO
      till now... I miss my recordsets :(

      Greetings from Germany
      André

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: my.settings and the connectionstrin g

        Andre,

        I have given you an answer in another newsgroup,

        Cor

        "Andre Rode" <Angel-HRO@gmx.de> schreef in bericht
        news:e74ava$urf $1@online.de...[color=blue]
        > Hi, a question
        >
        > I use a mdb database for my application. The application should be able to
        > handle more than one mdb, so I think I have to change
        > my.settings.Con String (this is my connectionstrin g) Like this
        > Provider=Micros oft.Jet.OLEDB.4 .0;Data Source=c:\DAT.m db;Persist Security
        > Info=True;Passw ord=password;Us er ID=user;Jet OLEDB:System
        > database=c:\sec urity.mdw;Jet OLEDB:Database Password=passwo rd
        >
        > The only thing I want to change is the data source element...
        >
        > But this setting is read only and the scope cannot be set to "User"
        >
        > Or am I on the wrong way?
        >
        > Greetings from Germany
        > Andre[/color]


        Comment

        Working...