my.settings and the connectionstring

A

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
 
T

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:
 
A

Andre Rode

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:
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é
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top