473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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.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
Jun 18 '06 #1
3 2295
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


Jun 18 '06 #2
to**************@uniroma1.it schrieb:
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é
Jun 19 '06 #3
Andre,

I have given you an answer in another newsgroup,

Cor

"Andre Rode" <An*******@gmx.de> schreef in bericht
news:e7**********@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

Jun 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pieter | last post by:
Hi, I'm using the Settings.settings of VB.NET to define a Connectionstring (Scope = application). When I deploy the Solution, and change this Setting in the app.config-file, it seems that...
3
by: Nuno | last post by:
At first, I was trying to encrypt ConnectionStrings in my app.config and still be able to modify my datasets. So, i had to modify the Settings.Designer.cs file to handle the decryption aspect in...
3
by: Kent Boogaart | last post by:
Hi, I am working on a web project and have split my data access layer into a separate DLL. This separate DLL uses a .settings file to store the connection string. A strongly-typed settings class...
4
by: HaVoK | last post by:
Hello, i am developing a website and want to use the connectionstring of my web.config in other sites. i have a connectionstring in my web.config like this: <configuration> <appSettings/>...
4
by: John | last post by:
Hi I need to store the path to db in my app. I have used app setting for this. Unfortunately various clients have different db paths and I have set them up once on each client location. The...
2
by: Robert Dufour | last post by:
Its easyb to change user leve settings but how do you change application level settings in code. Apparently it seems it can't be done. Duhhh. Anybody manage a workaround? Thanks for any help....
2
by: =?Utf-8?B?QWFyb24=?= | last post by:
I am trying to create dynamic settings in a .NET 2.0 C# application. I need to be able to store settings on the user, but I do not know how many settings are necessary at design time because the...
11
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have...
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have right clicked my project in VS2008 and added a DB Connection application setting. How do I access these settings from my code? I know this must be pretty simple, but I cannot see...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.