Home All Groups Group Topic Archive Search About

my.settings and the connectionstring

Author
18 Jun 2006 7:53 PM
Andre Rode
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.ConString  (this is my connectionstring) Like this
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DAT.mdb;Persist Security
Info=True;Password=password;User ID=user;Jet OLEDB:System
database=c:\security.mdw;Jet OLEDB:Database Password=password

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

Author
18 Jun 2006 8:41 PM
tommaso.gastaldi
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.ConnectionString = _
                      "Provider=Microsoft.Jet.OLEDB.4.0" & _
                      ";Data Source=" &
Me.InformazioniFileDatabase.NomeFile & _
                      ";User ID=" & UserId & _
                      ";Jet OLEDB:Database Password=" & Password & _
                      ";Mode=Share Deny None"

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

-tom

Andre Rode ha scritto:

Show quoteHide quote
> 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.ConString  (this is my connectionstring) Like this
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DAT.mdb;Persist Security
> Info=True;Password=password;User ID=user;Jet OLEDB:System
> database=c:\security.mdw;Jet OLEDB:Database Password=password
>
> 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
Author
19 Jun 2006 12:12 AM
Andre Rode
tommaso.gasta***@uniroma1.it schrieb:
Show quoteHide quote
> 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.ConnectionString = _
>                       "Provider=Microsoft.Jet.OLEDB.4.0" & _
>                       ";Data Source=" &
> Me.InformazioniFileDatabase.NomeFile & _
>                       ";User ID=" & UserId & _
>                       ";Jet OLEDB:Database Password=" & Password & _
>                       ";Mode=Share Deny None"
>
> the database property is just for information, once you have connected.
>
> -tom
>
> Andre Rode ha scritto:
>
>> 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.ConString  (this is my connectionstring) Like this
>> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DAT.mdb;Persist Security
>> Info=True;Password=password;User ID=user;Jet OLEDB:System
>> database=c:\security.mdw;Jet OLEDB:Database Password=password
>>
>> 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
>
Okay, seems to be another way.
But I use the connectionString defined in the settings for binding data
to my datagridviews. How will this work?

Should the ConnectionString 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é
Author
19 Jun 2006 4:28 AM
Cor Ligthert [MVP]
Andre,

I have given you an answer in another newsgroup,

Cor

Show quoteHide quote
"Andre Rode" <Angel-***@gmx.de> schreef in bericht
news:e74ava$urf$1@online.de...
> 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.ConString  (this is my connectionstring) Like this
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\DAT.mdb;Persist Security
> Info=True;Password=password;User ID=user;Jet OLEDB:System
> database=c:\security.mdw;Jet OLEDB:Database Password=password
>
> 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