List In A Database

paulthepaddy

Well-known member
Joined
Apr 9, 2011
Messages
222
Location
UK
Programming Experience
Beginner
Hey Guys, I Dont Know If This Is Possable But I Was Looking To Store A List into A Data base field. Il Give As Much Information As I Think Is Needed.

The DataBase :

The DataBase is accdb (dont know if it helps). It Has Multiple Tables And Is Saved Locally On Machine So I Dont Think Size Is An Issue Regaurding Performance.
The Table im Interested In Reguarding The Post Is Cars And Is As Follows.

Reg | Make | Model | Colour | Year | Customer | Price | Date | Inc Invoice | Assinged Ord Num | Work Done | Paid ------------------------------------------------------------------------------------------------------------------

The Plan Is That Work Done Coloum Will Store A List Of The Work Done, but it get complecated As Their Is Quite A Few Diffrent Things We Do On The Cars.
If Their Was A Way To Save A List To The Database Field That Would Be great. Or If Any One Could Think Of A Way To keep The Lists Of Damage Within The Database, As The Only Ways I Can Think Of Doing This Are Listed Below.

My Ideas On How To Do This :

1) Text File List's
I Was Thinking I Could Save The Damage Lists As A Text File And Name Them by Reg As Their Wont Be Multiple Regs, But I Think Their Is Far To Much Can Go Wrong Since I Would Be Working With The Database And Addintional Files.

2)
XmlSerializer
Since The Car Is Also A Class I Was Thinking I Could Serialise It Then Load The File When Needed but Again This Means Having The DB And Extra Files, kind of the same problem as above.

I Would Prefere If I Could Be Using The DataBase And Create The Car From The DataBase As I Plan To Be Loading The Cars Into Listboxs For A Few Diffrent Things.

Any Help Would Be Much Appreicated, Also I Would Like To Give Rep To Other People As It Wont Allow Me To Keep Giving Rep To The Same Person :D Im Sure They Know Who They Are

Thanks Guys


 
First things first, please do not ever use title case for your whole post again. It simply makes it harder to read. It is a scientifically proven fact that human beings read large blocks of text more easily when it is all lower case and upper case is only used for emphasis, like at the start of a sentence or in titles. That's why what you have used is commonly called "title case". Have you ever seen a book that uses text like yours?

As for the question, that's where the R in RDBMS comes in. You should create an other table to store the work done and then then you can have multiple work records per car record. The Car table has a CarID as it's primary key and each work record contains a CarID to indicate what Car record it is related to.
 
Hi, sorry for the title case, il keep that in mind, i normally use it as for me it looks neat.

And ok thanks for telling me about the RDBMS, never heard of it before so i shall go and read up about it now,

again sorry and thanks
 
hi again, i have been googling this and am not finding anything.

i have found LOTS on how they work and what they are, but i cant find anything on how to create and use one?

have you got any resource that you know of?
 
hi agian,

Yes i realized that, the RDBMS is (i think) more of the system used as in MS Acess or SQL.

i just found and was reading how to use the relationships in MS Access. im just trying to figure out all the settings as in one to many, many to many.

this is also confusing me lol. im trying to draw a graph so i know exactly what will be going where and how i am linking them all together but i pretty much think all my tables will be many to many :S i will see how this goes.

again thanks, i would give you more rep but im told i need to spread more around before giving you more :D
 
hi again, i cant figure out how to do this as i had read that a 'many to many' relationship doesn't work.

But i have the following tables

Untitled.png

But i would like to be able to search for a car, and get a list of invoices that the car is on

and i would like to be able to search for an invoice and get a list of cars that on that invoice

also

i dont understand how the workdone and car is going to work as this would also be a many to amny relastionship.

is their anything im missing?
 
Last edited:
You may not use these exact names but, assuming that you have a pre-defined list of jobs that can be performed, this is how it will work. You will have a Car table with a CarID column as the primary key. You will have a Job column with a JobID column as the primary key. Each car can have many jobs done on it and each job can be done on many cars, so it is a many-to-many relationship. To create that you have a Work table with a WorkID column as the primary key and CarID and JobID columns as foreign keys from the other two tables.
 
Back
Top