473,657 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing large arrays in a table

I have a training module db that stores information about employees
and what training they have carried our or need to carry out. One
table in this database stores what training needs to be carried based
on a job title. So if a cleaner joins the company we know that they
need the sweeping up training and the mopping up training. I wasn't
sure how to store this information but this is what i came up with and
as you will see i have hit a limitation. Now i know the solution i
came up with is probably very poor but it worked for a while. this was
my solution.
I created a table that has the job title as one column and another
column which stores a comma delimeted list of index numbers for each
module. When i need to add a module or check what modules are needed
for a job title i just parse the Comma delimeted list, put it into an
array and read the array. This worked fine until i hit the 255 char
limit on the text field. What would be the clever and proper way to
implement this in Access?

Apr 20 '07 #1
17 3571
You would simply move out that comma list to another table, and relate it
back to
your job title table (which in turn relates back to the employee table).

You could reduce the level of normalizing a bit, and repeat the job title
over and over for each training skill they have.

And, if you createa table of the actually job descrtipons for those job
numbers, then you, or your users could select the number from a combo box
that displays the disctrions for your users (it would make traiing and use
of yoru appcation much more user friendly).
The code will be much like:

Public Sub ProcessToChild( )

Dim rst As DAO.Recordset
Dim rstChild As DAO.Recordset

Dim strSql As String

Debug.Print "running.."
Set rstChild = CurrentDb.OpenR ecordset("tblCh ildTable")

strSql = "select id, JobTitle, Skills from MyTable " & _
"where Skills is not null"

Set rst = CurrentDb.OpenR ecordset(strSql )
Do While rst.EOF = False
Call StripOut(rstChi ld, rst!ID, rst!ChapterData )
rst.MoveNext
Loop
rst.Close

MsgBox "done"

End Sub

Public Sub StripOut(rst As DAO.Recordset, lngID As Long, strSkillData As
String)

Dim vBuf As Variant
Dim i As Integer
Dim strSkill As String

vBuf = Split(strSkillD ata, ",")
For i = 0 To UBound(vBuf)
'
rst.AddNew
rst!Parent_id = lngID
rst!Skill = vbuf(i)
rst.Update
Next i

rst.Update

End Sub
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com

Apr 20 '07 #2
By the way, you can change a text field to a memo field, and that allows
65000 characters...

The problem is how do you search, or built reports on this stuff???

If you use a table as I suggested, then you can use the reports sorting and
grouping options to produce counts of skills...an not have to use code to do
so....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
Apr 20 '07 #3
On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that allows
65000 characters...

The problem is how do you search, or built reports on this stuff???

If you use a table as I suggested, then you can use the reports sorting and
grouping options to produce counts of skills...an not have to use code to do
so....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com
Albert,

Apr 20 '07 #4
On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that allows
65000 characters...

The problem is how do you search, or built reports on this stuff???

If you use a table as I suggested, then you can use the reports sorting and
grouping options to produce counts of skills...an not have to use code to do
so....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com
Albert,
Many thanks for your quick reply
i didn't even think about using the Memo Data type
That will solve my problem
Many thanks

Apr 20 '07 #5
I did something similar with a menu system and ran into the same problem. Un
normalized data is the problem. You have a M-M relationship between Employee
and Training, setup 3 tables, tblEmployee, tblTraining and
tblEmploeeTrain ing.

tblEmploeeTrain ing has 3 fields
[EmployeeID] from tblEmploee
[TrainingID] from tblTraining
[Completed] Y/N

You will no longer need a function to lookup what training each employee
needs or has received. You can build forms and reports showing training for
each employee and which employee needs or has had each type of training, and
lookups will be almost instant.

"Stubert" <s.******@bdf.l td.ukwrote in message
news:11******** *************@b 75g2000hsg.goog legroups.com...
I have a training module db that stores information about employees
and what training they have carried our or need to carry out. One
table in this database stores what training needs to be carried based
on a job title. So if a cleaner joins the company we know that they
need the sweeping up training and the mopping up training. I wasn't
sure how to store this information but this is what i came up with and
as you will see i have hit a limitation. Now i know the solution i
came up with is probably very poor but it worked for a while. this was
my solution.
I created a table that has the job title as one column and another
column which stores a comma delimeted list of index numbers for each
module. When i need to add a module or check what modules are needed
for a job title i just parse the Comma delimeted list, put it into an
array and read the array. This worked fine until i hit the 255 char
limit on the text field. What would be the clever and proper way to
implement this in Access?

Apr 20 '07 #6
On Apr 20, 7:16 am, Stubert <s.mac...@bdf.l td.ukwrote:
On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that allows
65000 characters...
The problem is how do you search, or built reports on this stuff???
If you use a table as I suggested, then you can use the reports sorting and
grouping options to produce counts of skills...an not have to use code to do
so....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com

Albert,
Many thanks for your quick reply
i didn't even think about using the Memo Data type
That will solve my problem
Many thanks
Please note that Albert, by mentioning memo fields in his desire to
provide you with as comprehensive an answer as possible, has given you
a way to perpetuate a *terrible* design choice. In other words, those
comma-delimited lists are still a BAD idea, they can now simply become
larger and more unruly.

If this system of yours is really of any consequence, you have two
choices:

1. You can fix the design now (as described by Albert and Ron), or

2. You (or your successor, after you get fired) can fix the design
later.

It's your call....

Apr 20 '07 #7
On Apr 20, 10:23 am, Gord <g...@kingston. netwrote:
On Apr 20, 7:16 am, Stubert <s.mac...@bdf.l td.ukwrote:


On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that allows
65000 characters...
The problem is how do you search, or built reports on this stuff???
If you use a table as I suggested, then you can use the reports sorting and
grouping options to produce counts of skills...an not have to use code to do
so....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com
Albert,
Many thanks for your quick reply
i didn't even think about using the Memo Data type
That will solve my problem
Many thanks

Please note that Albert, by mentioning memo fields in his desire to
provide you with as comprehensive an answer as possible, has given you
a way to perpetuate a *terrible* design choice. In other words, those
comma-delimited lists are still a BAD idea, they can now simply become
larger and more unruly.

If this system of yours is really of any consequence, you have two
choices:

1. You can fix the design now (as described by Albert and Ron), or

2. You (or your successor, after you get fired) can fix the design
later.

It's your call....- Hide quoted text -

- Show quoted text -
Ron
It's actually a relationship between Job Title and Training not
employee and training.
The idea being that we can have a set amount of training for a
specific job title so that when an employee arrives we give him/her a
Job title and all the training modules are automatically given to that
employee. So the problem was how to store a Job title with it's
associated training Modules.
You are right of course Normalisation is the problem.
Albert,
Your idea, if understand it correctly (and i probably don't), would
still have a lot of duplicated data. If i had one record fro every Job
Title/Training Module number would get round the comma delimited list
problem but would end up with a really large table.
Gord
I'm glad you are not my boss but you are right Albert gave me an easy
way out which i have implemented for the time being however i would
like to improve it.
The comma list is not a good design, i agree, but it does work and it
works quickly there are no other issues with it apart from the one i
mentioned above. Any more suggestions will be greatly accepted

Apr 20 '07 #8

"Stubert" <s.******@bdf.l td.ukwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
On Apr 20, 10:23 am, Gord <g...@kingston. netwrote:
On Apr 20, 7:16 am, Stubert <s.mac...@bdf.l td.ukwrote:


On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that
allows
65000 characters...
The problem is how do you search, or built reports on this stuff???
If you use a table as I suggested, then you can use the reports
sorting and
grouping options to produce counts of skills...an not have to use
code to do
so....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com
Albert,
Many thanks for your quick reply
i didn't even think about using the Memo Data type
That will solve my problem
Many thanks
Please note that Albert, by mentioning memo fields in his desire to
provide you with as comprehensive an answer as possible, has given you
a way to perpetuate a *terrible* design choice. In other words, those
comma-delimited lists are still a BAD idea, they can now simply become
larger and more unruly.

If this system of yours is really of any consequence, you have two
choices:

1. You can fix the design now (as described by Albert and Ron), or

2. You (or your successor, after you get fired) can fix the design
later.

It's your call....- Hide quoted text -

- Show quoted text -

Ron
It's actually a relationship between Job Title and Training not
employee and training.
The idea being that we can have a set amount of training for a
specific job title so that when an employee arrives we give him/her a
Job title and all the training modules are automatically given to that
employee. So the problem was how to store a Job title with it's
associated training Modules.
You are right of course Normalisation is the problem.
Albert,
Your idea, if understand it correctly (and i probably don't), would
still have a lot of duplicated data. If i had one record fro every Job
Title/Training Module number would get round the comma delimited list
problem but would end up with a really large table.
Gord
I'm glad you are not my boss but you are right Albert gave me an easy
way out which i have implemented for the time being however i would
like to improve it.
The comma list is not a good design, i agree, but it does work and it
works quickly there are no other issues with it apart from the one i
mentioned above. Any more suggestions will be greatly accepted
You would have 2 relationship tables, one holding the training required for
each job title which would be copied to the employee's relationship table
when they are assigned a job title.
Apr 20 '07 #9
On 20 Apr, 17:36, "paii, Ron" <p...@packairin c.comwrote:
"Stubert" <s.mac...@bdf.l td.ukwrote in message

news:11******** **************@ e65g2000hsc.goo glegroups.com.. .


On Apr 20, 10:23 am, Gord <g...@kingston. netwrote:
On Apr 20, 7:16 am, Stubert <s.mac...@bdf.l td.ukwrote:
On 20 Apr, 12:02, "Albert D. Kallal" <PleaseNOOOsPAM mkal...@msn.com >
wrote:
By the way, you can change a text field to a memo field, and that
allows
65000 characters...
The problem is how do you search, or built reports on this stuff???
If you use a table as I suggested, then you can use the reports
sorting and
grouping options to produce counts of skills...an not have to use
code to do
so....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKa l...@msn.com
Albert,
Many thanks for your quick reply
i didn't even think about using the Memo Data type
That will solve my problem
Many thanks
Please note that Albert, by mentioning memo fields in his desire to
provide you with as comprehensive an answer as possible, has given you
a way to perpetuate a *terrible* design choice. In other words, those
comma-delimited lists are still a BAD idea, they can now simply become
larger and more unruly.
If this system of yours is really of any consequence, you have two
choices:
1. You can fix the design now (as described by Albert and Ron), or
2. You (or your successor, after you get fired) can fix the design
later.
It's your call....- Hide quoted text -
- Show quoted text -
Ron
It's actually a relationship between Job Title and Training not
employee and training.
The idea being that we can have a set amount of training for a
specific job title so that when an employee arrives we give him/her a
Job title and all the training modules are automatically given to that
employee. So the problem was how to store a Job title with it's
associated training Modules.
You are right of course Normalisation is the problem.
Albert,
Your idea, if understand it correctly (and i probably don't), would
still have a lot of duplicated data. If i had one record fro every Job
Title/Training Module number would get round the comma delimited list
problem but would end up with a really large table.
Gord
I'm glad you are not my boss but you are right Albert gave me an easy
way out which i have implemented for the time being however i would
like to improve it.
The comma list is not a good design, i agree, but it does work and it
works quickly there are no other issues with it apart from the one i
mentioned above. Any more suggestions will be greatly accepted

You would have 2 relationship tables, one holding the training required for
each job title which would be copied to the employee's relationship table
when they are assigned a job title.- Hide quoted text -

- Show quoted text -
Ron,
That's what i have done. But i think you are suggesting that the table
which holds the training required for each job title has a record for
each Job Title / Training module pair. We have currently around twenty
five job titles and Over 200 training modules. Now i know not every
job title will have every module but that still amounts to a lot of
records. In my table i have tewnty five records. One for each of the
job titles and a column with the commas seperated list. I thought that
was more compact. However your suggestion may make it easier to work
with.
Thanks for your reply

Apr 20 '07 #10

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

Similar topics

1
1422
by: nt9 | last post by:
I am very new with php so excuse me please if the question seems really easy.I have a page(form) which displays a list of the titles of some books(retreived from a database) and each title has a selection box with option values 1 to 7 each.The user should be able to enter 7 choices of his favourite books and store them in the database at a table called preferences with fields: customer_id ,first_choice, sec_choice,third_choice etc.I am...
2
1417
by: matthew.weiner | last post by:
I have a bunch of SPs that all rely on a UDF that parses a comma delimitted list of numbers into a table. Everything was working fine, but now my application is growing and I'm starting to approach the 8000 character limit of the varChar variable used to store the list. I would like to change the UDF only and avoid having to dig through all of my stored procedures. I was hoping to use the text datatype to allow for much larger lists,...
7
2773
by: C G | last post by:
Dear All, What's the best way to store jpgs in postgresql to use in a web page? I tried to use large objects, but how would you extract them from a table to be viewed in a web-page without having to write them to a scratch file somewhere first? Thanks
6
2488
by: Mudcat | last post by:
Hi, I am trying to build a tool that analyzes stock data. Therefore I am going to download and store quite a vast amount of it. Just for a general number - assuming there are about 7000 listed stocks on the two major markets plus some extras, 255 tradying days a year for 20 years, that is about 36 million entries. Obviously a database is a logical choice for that. However I've never used one, nor do I know what benefits I would get...
14
1800
by: John Welch | last post by:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As usual, I have several fields, such as "OrganizationTypeID" that will get values (via combo boxes in forms) from separate lookup tables. I know the 'correct' way to do this, using a long integer as the field type. In this case, however, I am considering doing it "incorrectly", by actually storing the text in my field rather than an ID, still using a lookup table,...
22
2538
by: guitarromantic | last post by:
Hey everyone, I run a site with staff-submitted reviews, and most of them are written by one author. However, we also do "multiple" reviews. Up until now I just had a userid for a 'Multiple' account and submitted them under that, but this makes it harder to print lists of all the reviews by one person, so ideally I wanna make a multiple select form so we can just select all the contributors and have the values saved in the database - in...
2
7046
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs, input box for units of service, description of the service and each row has its own dropdown list of unit fees that apply. Each dynamically created row will return 3 values fee1_choice, fee1_unit and fee1_money. Note The above informaton is...
10
2298
by: deciacco | last post by:
I'm writing a command line utility to move some files. I'm dealing with thousands of files and I was wondering if anyone had any suggestions. This is what I have currently: $arrayVirtualFile = array( 'filename'=>'filename', 'basename'=>'filename.ext', 'extension'=>'ext', 'size'=>0,
6
2906
by: Carl Banks | last post by:
I was wondering if anyone had any advice on this. This is not to study graph theory; I'm using the graph to represent a problem domain. The graphs could be arbitrarily large, and could easily have millions of nodes, and most nodes have a substantial amount of data associated with them. Obviously I don't want a whole such graph in memory at once, so libraries the just deal with in- memory graphs are out. I know I could implement this...
0
8323
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.