A Few questions - If people don`t mind

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Group,

Hows you all doing?

Im after a bit of advice, if you don`t mind?

1) How i setup some Validation checking? ie - check to make sure all my
textbox`s have been selected and that certain comboboxs have been selected,
and if not through a message saying "You have not filled out - Username,
Password, ADRCode" etc etc> If you get what i mean?

2) Could Somebody please point me in the right direction of a how to for
creating some Repair and compact code for a Access DB?

3) When My App Starts I would like the User to be able to select from a
local DB or a Network DB via a combobox. I`ve got my App to right the DB
paths to the Registary. Only problem is I have around 20 Database
Connections on my App now, how do i set it up to always look for the one
thats been selected?

Any Links or any advise would be much appriciated.

Many Thanks
Regards
MCN
 
Hi Simon,

Some answers,
1) How i setup some Validation checking? ie - check to make sure all my
textbox`s have been selected and that certain comboboxs have been selected,
and if not through a message saying "You have not filled out - Username,
Password, ADRCode" etc etc> If you get what i mean?

This I would just do in the event that starts the routine that is needed,
mostly a button click and use a errorprovider something as typed here watch
errors

\\\\
dim testcombobox(2) as combobox = New combobox() {Combobox1, Combobox2}
dim i as integer
for i = 0 to 1
if mycombobox1(2).selectedindex = -1
ErrorProvider1.SetError(testcombobox(i), "Needs to be selected.")
exit for
end if
next
////

2) Could Somebody please point me in the right direction of a how to for
creating some Repair and compact code for a Access DB?
http://support.microsoft.com/default.aspx?scid=kb;en-us;306287


3) When My App Starts I would like the User to be able to select from a
local DB or a Network DB via a combobox. I`ve got my App to right the DB
paths to the Registary. Only problem is I have around 20 Database
Connections on my App now, how do i set it up to always look for the one
thats been selected?

Just add it in the load event of your application
(I had a long time finding this, however just)
OleDBconnectionX = new OleDBconnection(and than the connectionstring)

I hope this helps?

Cor
 
Cor,

Going on the Multiple Database connections? Im a little confused Sorry:(

I`ve added 3 Reg Keys:
TestDB, LiveDB, and LocalDB

I`ve created a ComboBox with TestDB, LiveDB, and LocalDB, how would i get it
so when the user selects on from the ComboBox my project always uses the one
selected?

Many Thanks
MCN
 
Hi Simon,

I would make in the load event from your first form a showdialog form as you
did already

That form let say form3 has a public property or field, connString and a
combobox.

When that combobox is selected you close that form.

The code on form1 on the load event can than be

dim frm3 as new form3
if frm3.showdialog = message.Ok then ' this comes automaticly so I always
forget
YourOleDbConnection = new OleDbConnection(frm3.connString)
end if
frm3.dispose

I think this would do it.

Cor
 
Back
Top