VB.NET and ADO.NET - Modifying ConnectionString at run-time

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

I have a small application that uses oledb to connect to a database,
set up through the GUI wizards in vis studio. I am wanting to have
the database location kept in an .ini file along with the program so
that it can be changed to suit each particular user's setup.

The problem is that if I try to modify
OleDBCOnnection.ConnectionString at run-time, then I get an error
about the said connectionstring being un=initialized.

Anyone got any ideas?

Adam
 
Check out: HOW TO: Store and Retrieve Custom Information from an Application
Configuration File by Using Visual Basic .NET: http://tinyurl.com/394qm
This article demonstrates how to store custom information in a configuration
(.config) file that you can retrieve later during run time by its associated
application. This is a helpful when you need to define data that is
associated with an application.
 
Hi,

Quoting:
Check out: HOW TO: Store and Retrieve Custom Information from an Application
Configuration File by Using Visual Basic .NET: http://tinyurl.com/394qm
This article demonstrates how to store custom information in a configuration
(.config) file that you can retrieve later during run time by its associated
application. This is a helpful when you need to define data that is
associated with an application.

I'm having trouble seeing where this can help me. Can someone help me
a long a little bit please?

Thanks,

Adam
 
* (e-mail address removed) (Adam) scripsit:
I have a small application that uses oledb to connect to a database,
set up through the GUI wizards in vis studio. I am wanting to have
the database location kept in an .ini file along with the program so
that it can be changed to suit each particular user's setup.

The problem is that if I try to modify
OleDBCOnnection.ConnectionString at run-time, then I get an error
about the said connectionstring being un=initialized.

"Post code."
 
Adam,

The variable 'databasepath' holds the path. Don't use ini. Use xml. If you
need help how to do that let me know. I will try as long as I dont have
anyone cause problems for me...(don't ask)

Dim sConn1 As New OleDb.OleDbConnection
sConn1.ConnectionString = "Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Jet OLEDB:Database Password=;Data Source=" &
databasepath & _
";Password=;Jet OLEDB:Engine T" & _
"ype=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Je" & _
"t OLEDB:System database=;Jet OLEDB:SFP=False;Extended
Properties=;Mode=Share Den" & _
"y None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System
Database=False;J" & _
"et OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact
Without Replica Re" & _
"pair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"
 
(e-mail address removed)

BUSTED!!!!!!!!!

You can run but you can't hide.....

Deal with me jerk and I will go away.


-----Original Message-----
Adam,

The variable 'databasepath' holds the path. Don't use ini. Use xml. If you
need help how to do that let me know. I will try as long as I dont have
anyone cause problems for me...(don't ask)

Dim sConn1 As New OleDb.OleDbConnection
sConn1.ConnectionString = "Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Jet OLEDB:Database Password=;Data Source=" &
databasepath & _
";Password=;Jet OLEDB:Engine T" & _
"ype=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Je" & _
"t OLEDB:System database=;Jet OLEDB:SFP=False;Extended
Properties=;Mode=Share Den" & _
"y None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System
Database=False;J" & _
"et OLEDB:Don't Copy Locale on
Compact=False;Jet OLEDB:Compact
 
OK I give.....I am way too busy for this crap and this group is too
important too me.

What will it take for you to leave me and everyone else alone in here?
 
FINALLY YOU ACKNOWLEDGE MY VICTORY!!

you realize you have to deal with me for me to go
forward. You see it is about respect.

Now all you have to do is fulfill my requests and I am
gone.......

1. You must apologize and admit I am right.(In this forum
in front of all your friends)

2. Ryan, HerfriedChicken, Spink must apologize. That is
all I can ask. I was a little hard on them as they were
caught in the cross fire. If you had not wimped out they
would have never gotten involved. You should have showed
some b--ls and taken the heat instead of making your
friends do it.

3. You must take down the web page with that fu---ed up
code sample.

4. You must write me a program that will allow me to send
mass emails without getting caught. You and your skill I
am sure can acomplish that. YOU HAVE TO WRITE IT. No one
can help you especially Spinks. You will post the program
for download on your web page where the code sample used
to be.
 
Um, let me step in here...that isn't going to happen because the closest
you'll get from me in terms of apologies is **** OFF! Hefried is a Chicken?
Last I looked his posts contain contact information. Same with Spink. And
all of us can write our own code, something that you don't seem able to do.
 
Don't hold your breath.
IAmIronMan said:
FINALLY YOU ACKNOWLEDGE MY VICTORY!!

you realize you have to deal with me for me to go
forward. You see it is about respect.

Now all you have to do is fulfill my requests and I am
gone.......

1. You must apologize and admit I am right.(In this forum
in front of all your friends)

2. Ryan, HerfriedChicken, Spink must apologize. That is
all I can ask. I was a little hard on them as they were
caught in the cross fire. If you had not wimped out they
would have never gotten involved. You should have showed
some b--ls and taken the heat instead of making your
friends do it.

3. You must take down the web page with that fu---ed up
code sample.

4. You must write me a program that will allow me to send
mass emails without getting caught. You and your skill I
am sure can acomplish that. YOU HAVE TO WRITE IT. No one
can help you especially Spinks. You will post the program
for download on your web page where the code sample used
to be.
 
I would not even consider building you any kind of program. You are crossing
the line from merely libelous to potentially illegal activity. As a
Christian and my code of conduct as a programmer would never allow this.

I look at you and your requests with the same disdain that those who build
things like Gator and GAIN recieve. You have to read between the lines to
understand how harsh that statement is.

Your other requests are nothing but foolishness. I may take down the web
page if that will placate you since this all got started over this.

These other people are primarily my colleagues not my friends. Some are my
friends. They are not defending me as much as the principal of this
newsgroup. I have neither the time nor the inclination to talk to you about
this as it is throwing pearls before swine. This is their home and you
invaded. By your own admission, they are not at fault. So leave them be.

I think we have reached the point that my participation in this group which
you seem to be trying to stop and discredit has reached the point where I
have become a more of a distraction that a benefit to those around me.
What I have done to you to deserve this is beyond my imagination.

It is probably time for me to take a hiatus and hope I can come back
eventually.

Yes you won. You got me out and if that is important to you take that
victory and run with it.

Later .....
 
FINALLY YOU ACKNOWLEDGE MY VICTORY!!

OMG, these last few days .. funny crap.. still crap, tho...

But really doesn't belong in this newsgroup...

Please direct further posts to
alt.teenager.inflated-ego.socially-inept.flame-wars..

// CHRIS
 
* "scorpion53061 said:
OK I give.....I am way too busy for this crap and this group is too
important too me.

What will it take for you to leave me and everyone else alone in here?

Scorp: Just change your name for some days, and Ironman will get bored.

;-)
 
Again you show your true colors:

1. You refuse to help me.
2. you tell your friends to hate me.
3. You failed to follow directions.

For this disrespect your group will suffer till you bend
to my will. YOU ARE A PUNK AND COWARD.
 
I AM NOT STUPID.

IT DOES NOT MATTER. I AM GOING TO BE HERE UNTIL SCORPION,
SPINKS, HERFRIEDCHICKEN, AND RYAN APOLOGIZE AND ADMIT I
AM RIGHT.

By the way scorpion guess what? I called your employer
today and told them what an ass you are. You should know
better than to post your work location. what an idiot.
 
You are stupid and you ride the short bus as everyone here has noticed. How
is it that so many disparate people realize you are a total short bus riding
retard? And you're stupid. I bet scorp is trembling in his shoes right
now... please call my employer too www.infoprogroup.com 706.724.1555 Tell my
boss what an ass I am. I'm sure he'll be very receptive. He'll maybe you
can have my job too, but you'll have to figure out how to write your won
code.

Scorp posts his contact info, you post like a total retard chickenshit and
you call him a punk?
 
KILL FILE !!! Kill file the idiot and quit responding to his posts!! He
will go somewhere else and quite bothering the grownups.
james
 
Back
Top