473,480 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB '08 - Need to save unknown number of items to a single entry in access

10 New Member
So I'm making a character creator for a game I'm working on in my spare time.
For each character, powers can be chosen. Based on the character type there is a very large level of variance for how many powers can possibly be chosen.

What I need to be able to do is take a set of items from a listbox and save them to the access database. Each character is it's own row in the database.

I have it set to be able to save everything but this to the database... but this is throwing me for a loop.

Any suggestions would be appreciated.
Nov 20 '08 #1
5 1628
debasisdas
8,127 Recognized Expert Expert
Question moved to .NET forum.
Nov 21 '08 #2
Montravont
10 New Member
Nevermind, problem resolved. Saving the items from the list box as a comma seperated value to the database, then using split.string with "," as the delimiter to break it apart again.
Dec 9 '08 #3
balabaster
797 Recognized Expert Contributor
@Montravont
Is there a reason you wouldn't link two tables by a key rather than using a CSV field. I personally can't stand CSV fields in a database - but that's just me. Maybe you have a good reason, but for 1 to many relationships, I would normally expect to see two tables, one for the parent record (i.e. the character) and one for the variable amount of items for that parent (i.e. the character's variable amount of powers).
Dec 9 '08 #4
Montravont
10 New Member
@balabaster
It's actually more for the creation of the powers as well as for what powers the character has. The main problem turned out to be more with the power creation. I have a table for the powers, and I have tables holding the different variables for the different types of items that can be added to a power at creation.

CSV? Primarily because I'm not aware of (read: don't know) a better way to do it.

CSV seems to work for what I'm trying to accomplish but I'm all for effeciency.
Dec 10 '08 #5
Curtis Rutland
3,256 Recognized Expert Specialist
A better way (at least, from a relational DB perspective it's better) to do it is have another table, linked to the master record's ID, with each entry having it's own row, rather than being in one CSV field.

Example:
Expand|Select|Wrap|Line Numbers
  1. //table 1
  2. IDt1 | CSVCol
  3. 1    | a, b,c
  4. 2    | a,d,e
  5.  
  6. //table 2, making CSVCol unnecessary
  7. IDt2 | IDt2 | val
  8. 1    |1     | a
  9. 2    |1     | b
  10. 3    |1     | c
  11. 4    |2     | a
  12. 5    |2     | d
  13. 6    |2     | e
  14.  
Dec 10 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2151
by: Piet | last post by:
Hello wxPythoneers. I have a problem with a dialog box derived from wxFrame which has a wxComboBox as main element. Depending on the entry selected from the ComboBox, the dialog box will be...
3
1573
by: Mike | last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or comments on how to make this work I would be grateful! I have been working on this for the past 4 days and nothing I do...
9
2824
by: Simon | last post by:
Hi, if I have a structure like... struct sMyPointers{ ClassA *m_pPointerA; ClassB *m_pPointerB; void *m_pPointerToSomethingElse; };
19
4061
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
11
2775
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field...
21
3163
by: Johan Tibell | last post by:
I would be grateful if someone had a minute or two to review my hash table implementation. It's not yet commented but hopefully it's short and idiomatic enough to be readable. Some of the code...
11
4467
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
7
2104
by: Kesavan | last post by:
Is there any way to run a function or a code-block whenever the client- server communication breaks off. (ie power-off, browser-crash...) Why I need this is, I want to update a login-table to...
23
4329
by: Himanshu Chauhan | last post by:
Hi! I was wondering, In the first parse of a singly linked list of unknown length, is it possible to know when we are at middle of the linked list? Regards --Himanshu
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
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...
0
7060
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,...
0
7106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6760
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...
0
7022
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...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
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 ...

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.