Adding database strings

Hi,
I have a windows application and I want to include a form that the user will access and change the strings to the database.
I assume that form will have the following entries:
Connection String
Server Name
Username
Password
I really would like to get a better logic of how this works. The application as it it now it has the settings of the computer I am working on and everytime I compile I have to change them from the properties box to allow them to work on another users computer. So if the application is installed in another location I would like to give the user to change the database settings / strings from a form within the application
I hope my question is clear.
litewaysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
It isn't clear what problem you are having.

However, you could make it easier if the relevant data were saved on on the computer, so that the boxes can be filled with the saved data. There are VB methods SaveSetting and GetSetting that can be used to keep the data in the registry between sessions of the application.

You should show the form modally. When the OK button is clicked, validate the data and close the form if it is all valid. Otherwise indicate what data is not acceptable (e.g. by showing a label adjacent to the invalid textbox). The Cancel button should end the application.

0
litewaysAuthor Commented:
Hi Graham....
How can I go about and work on the first part of your comment?
0
GrahamSkanRetiredCommented:
Sorry I still don't undertand what problem you are having, so I could be missing the point.

1. Have a code start procedure, not a form
2. In the the start procedure, load the form modally
3. In the Form_Load Event have entries like this:

Form1.TextBox1.Text =  GetSetting("MyApplication", "MySettings", "Database Name", "")

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.