Avatar of charlieb01
charlieb01
 asked on

Need help building and Access (mdb) table from an existing table in VB.NET 2010

I have an Access (MDB) database that contains a table named NOZZLES and need to create a new table caalled NOZZLECOMBO. All of this need to be done programatically in VB.NET 2010.
I can create the template for the NOZZLECOMBO table but need help getting the data in.
Basically I have a NOZZLES table that consists of various size flow nozzles (sometimes the same size appears mor than once but needs to be treated separately since its exact measurement may differ from the other nozzle of the same nominal size.

Ultimately my progarm will use the data in the NOZLECOMBO table to determine which nozzle combination to use for a specific task.
Here is the layout of the NOZZLES table

NozID      NozSize      LOLO      LO      HI      HIHI
Noz1      3      100      150      275      300
Noz2      4      200      260      600      700
Noz3      5      500      650      900      1000
Noz4      6      700      800      1100      1300
Noz5      6      700      800      1100      1300


And here is a possible layout of the NOZZLECOMBO TABLE that needs to be built:

Comb      Noz1      Noz2      Noz3      Noz4      Noz5      LOLO      LO      HI      HIHI
1      3                              100      150      275      300
2            4                        200      260      600      700
3                  5                  500      650      900      1000
4                        6            700      800      1100      1300
5                              6      700      800      1100      1300
6      3      4                        300      410      875      1000
7      3            5                  600      800      1175      1300
8      3                  6            800      950      1375      1600
9      3                        6      800      950      1375      1600
10            4      5                  700      910      1500      1700
11            4            6            1100      1360      2250      2600
12            4                  6      900      1060      1700      2000
13                  5      6            1200      1450      2000      2300
14                  5            6      1200      1450      2000      2300
15                        6      6      1400      1600      2200      2600
16      3      4      5                  800      1060      1775      2000
17      3            5      6            1300      1600      2275      2600
18      3      4            6            1000      1210      1975      2300
19      3            5      6            1300      1600      2275      2600
20            4      5      6            1400      1710      2600      3000
21                  5      6      6      1900      2250      3100      3600
22      3            5      6      6      2000      2400      3375      3900
23      3      4      5      6      6      2200      2660      3975      4600


Some combinations may seem to be duplicate but as I said the actual size of a nozzle may differ from one of the same nominal size (there may be two 6 inch nozzles but the first may actually be 5.95 and the other may be 6.1 and that will change the flow capacity.

My program will always try to use numbers between LO and HI but I will allow it to got down as low as LOWLOW and as high as HIHI

So what I need is help building the NOZLECOMBO table - making sure all of the possible combinations exist and end up in ascending order based on the LOLO data for each combination.
One final point: these may be as many as 12 different nozzles (depending on the application) but I think if I can get help with 5 nozzles then 12 will jest be more of the same.

Thanks, Charlie
Programming Languages-Other.NET ProgrammingMicrosoft Access

Avatar of undefined
Last Comment
charlieb01

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Beartlaoi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
charlieb01

ASKER
This appears to be a very complete program and a lot of effort

I am having a problem however at line 13

Dim rdrNozzles = cmdReadNozzles.ExecuteReader()

The error:
ExecuteReader requires an open and available Connection. The connection's current state is closed.

I don't know what to do with this.

Any help
Beartlaoi

Do you have a file named Nozzles.accdb in the same folder as your exe?
If not either put your database there with that name or change line 6 so it can find your database.
charlieb01

ASKER
My database is an older version *.mdb (for compatability reasons) and I missed a line when changing that part of the code.
Also, my real airflow numbers are Double not Integer so I had to make a few changes to accomodate that but OTHERWISE:

This was the BEST assistance I have ever received since joining experts-exchange. I had no idea how I was going to do this and you came up with the perfect program. Fot that, I am extremly grateful. You are truly a master.

Thanks,
Charlie
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
charlieb01

ASKER
Fantastic Solution
charlieb01

ASKER
Just a follow-up,
On Line 111, the second = sign should be a + sign