473,394 Members | 1,203 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Storing data

50
Hi,

This is my first attempt of making a standalone application, so I would appreciate any help on this :)

I want to include in the program - that will be a .exe - a default dataset and give the user the option to use their own dataset.

What is the best way to do this, the recordset is about 3000 records long. Should I hardcode this? Or is there a way to bundle the dataset as a text file with the program.

Many thanks in advance
Aug 18 '07 #1
4 1488
bartonc
6,596 Expert 4TB
Hi,

This is my first attempt of making a standalone application, so I would appreciate any help on this :)

I want to include in the program - that will be a .exe - a default dataset and give the user the option to use their own dataset.

What is the best way to do this, the recordset is about 3000 records long. Should I hardcode this? Or is there a way to bundle the dataset as a text file with the program.

Many thanks in advance
Hand code: No.
3000 records? Too big for the registry.
Hmmm: True data base? Sounds like there's one in the application (details would be nice); SQL?, etc. In that case, I'd use a SQL script (extracted from your own db) and have the target db execute it.

Otherwise, the ConfigParser might be a good way to go.
Aug 18 '07 #2
kdt
50
Hi BartonC,

Thanks for the response. Currently I have the records in a text file that I open and read from a script. As I am trying to make the script a standalone application, and include the default dataset. Do you think it would be okay to bundle the text file with the program, and if the user selects "use default dataset" that it could just open "sample.txt" from there. I don't want to have to use a backend db with this. If I have to go down this route maybe sqllite would be a good idea?

Cheers for the response
Aug 18 '07 #3
bartonc
6,596 Expert 4TB
Hi BartonC,

Thanks for the response. Currently I have the records in a text file that I open and read from a script. As I am trying to make the script a standalone application, and include the default dataset. Do you think it would be okay to bundle the text file with the program, and if the user selects "use default dataset" that it could just open "sample.txt" from there. I don't want to have to use a backend db with this. If I have to go down this route maybe sqllite would be a good idea?

Cheers for the response
Not sure if a .txt file counts as a resource in an executable.
Besides, if it's kept external, it's adjustable (like ini files).

Nor have I played with SQLLite.

What you could do is define your dataset in pure python:
Expand|Select|Wrap|Line Numbers
  1. class recordset:
  2.     attr1 = value1
  3.     # etc.
  4.  
  5. # or
  6.  
  7. recordset = (
  8. (val1, val2, etc)
  9. (val1, val2, etc)
  10. (val1, val2, etc)
  11. (val1, val2, etc)
  12. )
and import that. This looks like hand coding, but could be generated from your text file.

It's really just a text file, but as long is you use python syntax/import it'll work.
Aug 18 '07 #4
kdt
50
Not sure if a .txt file counts as a resource in an executable.
Besides, if it's kept external, it's adjustable (like ini files).

Nor have I played with SQLLite.

What you could do is define your dataset in pure python:
Expand|Select|Wrap|Line Numbers
  1. class recordset:
  2.     attr1 = value1
  3.     # etc.
  4.  
  5. # or
  6.  
  7. recordset = (
  8. (val1, val2, etc)
  9. (val1, val2, etc)
  10. (val1, val2, etc)
  11. (val1, val2, etc)
  12. )
and import that. This looks like hand coding, but could be generated from your text file.

It's really just a text file, but as long is you use python syntax/import it'll work.
Hehe, very nice idea indeed, it should also be bundled with the .exe automatically now.

Thanks :)
Aug 18 '07 #5

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

Similar topics

2
by: Francisco | last post by:
I have this problem: I have a database with information about games, and users are able to vote for them. Everytime a user votes for a game I store the unique game name into a session variable (an...
1
by: Kay | last post by:
A linked list is storing several names. I want to make a queue if I input a name that is same as the linked list. How to make each node of a linked list storing a queue that are different with each...
7
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data...
6
by: bissatch | last post by:
Hi, I am currently writing a news admin system. I would like to add the ability to add images to each article. What I have always done in the past is uploaded (using a form) the image to a...
1
by: VMI | last post by:
Is it possible to store the data in a datatable in the hard disk instead of the memory? By default, when a datatable's being filled, the table (and data) will remain in memory. Would it be possible...
6
by: Kyle Teague | last post by:
What would give better performance, serializing a multidimensional array and storing it in a single entry in a table or storing each element of the array in a separate table and associating the...
6
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to...
20
by: Martin Jørgensen | last post by:
Hi, I'm reading a number of double values from a file. It's a 2D-array: 1 2 3 4 5 6 7 ------------- 1 3.2 2 0 2.1 3 9.3 4
7
by: Mike | last post by:
I have developed an application, for psyc patients.... they type in very personal information in a web form to help them work through problems in their lives. Once they enter the info, I encrypt...
4
by: Falcolas | last post by:
I personally feel that it's a bad idea. I've got to convince managerial types of this. Would some of you mind posting comments for and against the concept of storing data in XML attributes? If...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...

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.